From 20246508ca43e5987e331263445f1aaa989b9d93 Mon Sep 17 00:00:00 2001 From: Muhammad Tauqir Ahmad Date: Wed, 20 Nov 2013 17:50:46 -0500 Subject: [PATCH] Add mtahmed theme. --HG-- extra : amend_source : e3eb545150f7c4aa5ccaca80a64649419d154e6d --- themes/mtahmed/README.md | 15 +++++++++++++++ themes/mtahmed/fish_prompt.fish | 19 +++++++++++++++++++ themes/mtahmed/fish_right_prompt.fish | 12 ++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 themes/mtahmed/README.md create mode 100644 themes/mtahmed/fish_prompt.fish create mode 100644 themes/mtahmed/fish_right_prompt.fish diff --git a/themes/mtahmed/README.md b/themes/mtahmed/README.md new file mode 100644 index 0000000..1804775 --- /dev/null +++ b/themes/mtahmed/README.md @@ -0,0 +1,15 @@ +## mtahmed + +Minimal theme. + +![mtahmed theme](http://csclub.uwaterloo.ca/~mtahmed/media/images/fish.png) + +#### Left prompt + +- First 10 characters of hostname if `ssh`'ed +- Current directory name (not path) +- ─╼ (cute little unicode characters) + +#### Right prompt + +- Exit code of the previous command diff --git a/themes/mtahmed/fish_prompt.fish b/themes/mtahmed/fish_prompt.fish new file mode 100644 index 0000000..24afde8 --- /dev/null +++ b/themes/mtahmed/fish_prompt.fish @@ -0,0 +1,19 @@ +# name: mtahmed +# Left prompt: +# - First 10 characters of hostname if ssh'ed +# - Current directory name +# - ─╼ +# Right prompt: +# - Exit code of the previous command +function fish_prompt + set_color $fish_color_cwd + if [ -n "$SSH_CONNECTION" ] + printf '%s | ' (hostname | head -c 10) + end + if [ "$HOME" = (pwd) ] + printf "~" + else + printf (basename (pwd)) + end + printf " ─╼ " +end diff --git a/themes/mtahmed/fish_right_prompt.fish b/themes/mtahmed/fish_right_prompt.fish new file mode 100644 index 0000000..c8eb8b5 --- /dev/null +++ b/themes/mtahmed/fish_right_prompt.fish @@ -0,0 +1,12 @@ +# name: mtahmed +# Left prompt: +# - First 10 characters of hostname if ssh'ed +# - Current directory name +# - ─╼ +# Right prompt: +# - Exit code of the previous command +function fish_right_prompt + set -l last_status $status + set_color $fish_color_cwd + printf $last_status +end