Fish shell prompt with pijul support
function parse_pijul_channel

    set -Ux mark ""
    set -x channel_icon " ⛕ "
    set -x birdie " 🐦 "

    pijul channel &> /dev/null
    if test $status -eq 0
        set -x channel (pijul channel 2> /dev/null | grep -e '\*' | sed 's/*//' ) # Greping out channel name and striping asterix
        set -x repo_name (pwd | rev | cut -d'/' -f1 | rev)  # Grabbing last directory in the Path ()
        set -x my_pwd (pwd | sed 's,/*[^/]\+/*$,,')         # Grabbing Pwd without last directory

        # Yellow PWD with space at the end
        set_color -b yellow
        set_color black
        echo -n $my_pwd
        echo -n ' '

        # Yellow marker at the end of pwd
        set_color -b red
        set_color yellow  
        echo -n $mark; set_color normal

        # Red Bird icon and repository name
        set_color -b red   
        set_color black
        echo -n $birdie;
		echo -n $repo_name 
        echo -n ' '; set_color normal  

        # Red marker
        set_color -b green
        set_color red
        echo -n $mark

        # Green channel icon and channel name
        set_color -b green
        set_color black
        echo -n $channel_icon
        echo -n $channel
        echo -n ' '; set_color normal

        # Green mark
        set_color -b black 
        set_color green
        echo -n $mark; set_color normal
    else
        set_color -b yellow
        echo -n (pwd)
        echo -n ' '
        
        set_color -b black
        set_color yellow
        echo -n $mark; set_color normal
    end  
end

function fish_prompt
    
    # Blue name@host
    set_color -b blue
    set_color black

    echo -n (whoami)
    echo -n "@"
    echo -n (hostname) 
    echo -n ' '

    # Blue mark
    set_color -b yellow
    set_color blue
    echo -n $mark; set_color black

    echo -n ' '
    echo -n (parse_pijul_channel)
    echo -n ' ' 
end