Created
April 21, 2016 09:44
-
-
Save smokku/0d478eec7ab0a52705ce6e83e7d310dc to your computer and use it in GitHub Desktop.
fish prompt with hostname emoji and git status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fish_prompt --description 'Write out the prompt' | |
set -l last_status $status | |
if not set -q __fish_prompt_normal | |
set -g __fish_prompt_normal (set_color normal) | |
end | |
# hostname emoji | |
for name in (hostname | tr . '\n') | |
switch $name | |
case home | |
printf "🏠 " | |
break | |
case work | |
printf "🏭 " | |
break | |
case tv | |
printf "📺 " | |
break | |
case lan local | |
printf "💻 " | |
break | |
end | |
end | |
# time | |
printf '%s ' (date "+%H:%M") | |
# PWD | |
set_color $fish_color_cwd | |
echo -n (prompt_pwd) | |
set_color normal | |
printf '%s ' (__fish_git_prompt) | |
if not test $last_status -eq 0 | |
set_color $fish_color_error | |
end | |
echo -n '$ ' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment