diff options
| author | Yigit Sever | 2021-11-11 18:36:14 +0300 |
|---|---|---|
| committer | Yigit Sever | 2021-11-11 18:36:14 +0300 |
| commit | bcd732aacc6a1bad700c8ceca5974656cbfc3cf2 (patch) | |
| tree | dcd115b90a5b54a31d0eecdc2c03053484f0ed25 /.config/fish/functions/fish_prompt.fish | |
| parent | a572a619da2464a234af7500f095c776c5c39df1 (diff) | |
| download | dotfiles-bcd732aacc6a1bad700c8ceca5974656cbfc3cf2.tar.gz dotfiles-bcd732aacc6a1bad700c8ceca5974656cbfc3cf2.tar.bz2 dotfiles-bcd732aacc6a1bad700c8ceca5974656cbfc3cf2.zip | |
fish: welcome!
Diffstat (limited to '.config/fish/functions/fish_prompt.fish')
| -rw-r--r-- | .config/fish/functions/fish_prompt.fish | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ | |||
| 1 | function fish_prompt | ||
| 2 | set -l __last_command_exit_status $status | ||
| 3 | |||
| 4 | set -l cyan (set_color -o cyan) | ||
| 5 | set -l red (set_color -o red) | ||
| 6 | set -l green (set_color -o green) | ||
| 7 | set -l normal (set_color normal) | ||
| 8 | |||
| 9 | set -l marker_color "$green" | ||
| 10 | if test $__last_command_exit_status != 0 | ||
| 11 | set marker_color "$red" | ||
| 12 | end | ||
| 13 | |||
| 14 | set -l marker "$marker_color" "δ" | ||
| 15 | if fish_is_root_user | ||
| 16 | set marker "$marker_color# " | ||
| 17 | end | ||
| 18 | |||
| 19 | set -l cwd $cyan (string join / (string split -rn -m3 / (prompt_pwd) | tail -n3)) | ||
| 20 | |||
| 21 | echo -n -s $marker ' '$cwd $normal ' ' | ||
| 22 | end | ||
