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 +