Skip to content

Instantly share code, notes, and snippets.

@deseven
Last active Dec 27, 2019
Embed
What would you like to do?
fish theme used in interService
function fish_prompt --description 'Write out the prompt'
set laststatus $status
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname)
end
set_color -b black
if test $laststatus -eq 0
#printf "[%s$status%s] " (set_color -o green) (set_color normal)
else
printf "[%s$status%s] " (set_color -o red) (set_color normal)
end
printf '%s%s%s%s%s%s%s%s%s%s%s%s%s' (set_color white) '' (set_color yellow) $__fish_prompt_hostname (set_color white) ':' (set_color green) (echo $PWD | sed -e "s|^$HOME|~|") (set_color white) '' (set_color white)
set_color normal
if test (id -u) -eq 0
echo "# "
else
echo "\$ "
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment