From 9483a86f0786d7cd13e277550287538c00ed0553 Mon Sep 17 00:00:00 2001 From: Shawn Anderson Date: Thu, 27 Oct 2022 15:11:44 -0700 Subject: [PATCH] Create right fish prompt with time and watch emoji. Add spaces to match tmux power. --- .../fish/functions/fish_right_prompt.fish | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dotfiles/.config/fish/functions/fish_right_prompt.fish diff --git a/dotfiles/.config/fish/functions/fish_right_prompt.fish b/dotfiles/.config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..9c7b3f1 --- /dev/null +++ b/dotfiles/.config/fish/functions/fish_right_prompt.fish @@ -0,0 +1,19 @@ +# fish theme: gentoo + +function fish_right_prompt + set -l last_status $status + set -l cyan (set_color -o cyan) + set -l red (set_color -o red) + set -l normal (set_color normal) + + # print last exit code if nonzero: + if test $last_status -ne 0 + set_color red + printf '%d' $last_status + set_color normal + end + + # display the timestamp on the utmost right. + echo -n -s $normal '⌚ ' (date +%H:%M:%S) ' ' +end +