Skip to content

Instantly share code, notes, and snippets.

@smokku
Created April 21, 2016 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smokku/0d478eec7ab0a52705ce6e83e7d310dc to your computer and use it in GitHub Desktop.
Save smokku/0d478eec7ab0a52705ce6e83e7d310dc to your computer and use it in GitHub Desktop.
fish prompt with hostname emoji and git status
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