From bcd732aacc6a1bad700c8ceca5974656cbfc3cf2 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Thu, 11 Nov 2021 18:36:14 +0300 Subject: fish: welcome! --- .config/fish/functions/fish_prompt.fish | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .config/fish/functions/fish_prompt.fish (limited to '.config/fish/functions/fish_prompt.fish') diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..24e6e71 --- /dev/null +++ b/.config/fish/functions/fish_prompt.fish @@ -0,0 +1,22 @@ +function fish_prompt + set -l __last_command_exit_status $status + + set -l cyan (set_color -o cyan) + set -l red (set_color -o red) + set -l green (set_color -o green) + set -l normal (set_color normal) + + set -l marker_color "$green" + if test $__last_command_exit_status != 0 + set marker_color "$red" + end + + set -l marker "$marker_color" "δ" + if fish_is_root_user + set marker "$marker_color# " + end + + set -l cwd $cyan (string join / (string split -rn -m3 / (prompt_pwd) | tail -n3)) + + echo -n -s $marker ' '$cwd $normal ' ' +end -- cgit v1.2.3-61-g4310