summaryrefslogtreecommitdiff
path: root/.config/fish/functions
diff options
context:
space:
mode:
authorTom Barrett <spalf0@gmail.com>2019-09-03 07:54:01 -0500
committerTom Barrett <spalf0@gmail.com>2019-09-03 07:54:01 -0500
commitb0a3f691541903ebf8109eba968c0d4b4ba54b21 (patch)
tree20c11e7c023edcb07a95b9c2c9eb0930014c710f /.config/fish/functions
parent77a4636b09d49a1c8bf1cadd57cbe4a634d61fa3 (diff)
more paths, firefox desktop and download dirs, aerc makefile change, new src directory
Diffstat (limited to '.config/fish/functions')
-rw-r--r--.config/fish/functions/fish_prompt.fish42
1 files changed, 42 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..7f4860d
--- /dev/null
+++ b/.config/fish/functions/fish_prompt.fish
@@ -0,0 +1,42 @@
+function fish_prompt --description 'Write out the prompt'
+
+ set stat $status
+
+ if not set -q __fish_prompt_normal
+ set -g __fish_prompt_normal (set_color normal)
+ end
+
+ if not set -q __fish_color_blue
+ set -g __fish_color_blue (set_color -o blue)
+ end
+
+ #Set the color for the status depending on the value
+ set __fish_color_status (set_color -o green)
+ if test $stat -gt 0
+ set __fish_color_status (set_color -o red)
+ end
+
+ switch "$USER"
+
+ case root toor
+
+ if not set -q __fish_prompt_cwd
+ if set -q fish_color_cwd_root
+ set -g __fish_prompt_cwd (set_color $fish_color_cwd_root)
+ else
+ set -g __fish_prompt_cwd (set_color $fish_color_cwd)
+ end
+ end
+
+ printf '%s@%s %s%s%s# ' $USER (prompt_hostname) "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal"
+
+ case '*'
+
+ if not set -q __fish_prompt_cwd
+ set -g __fish_prompt_cwd (set_color $fish_color_cwd)
+ end
+
+ printf '[%s] %s%s@%s %s%s %s(%s)%s \f\r> ' (date "+%H:%M:%S") "$__fish_color_blue" $USER (prompt_hostname) "$__fish_prompt_cwd" "$PWD" "$__fish_color_status" "$stat" "$__fish_prompt_normal"
+
+ end
+end