diff --git a/conf.d/30_prompt.fish b/conf.d/30_prompt.fish new file mode 100644 index 0000000..194f7a5 --- /dev/null +++ b/conf.d/30_prompt.fish @@ -0,0 +1,51 @@ +# Shell prompt: Left side + +function fish_prompt + set -l exit_status $status + set -l prompt_symbol + set -l user_color + set -l symbol_color + + # User + if fish_is_root_user + set user_color bf1d3c + set prompt_symbol '#' + else + set user_color 2ca2dd + set prompt_symbol '$' + end + + # Prompt symbol colour + if test $exit_status -eq 0 + set symbol_color 435b12 + else + set symbol_color ff3232 + end + + # Username (bold) + set_color --bold $user_color + printf "%s" $USER + + # Separator + set_color normal + printf "@" + + # Host + set_color 2cb446 + printf "%s" (prompt_hostname) + + # Separator + set_color normal + printf ":" + + # Working directory + set_color 484848 + printf "%s" (prompt_pwd) + + # Prompt symbol (bold) + set_color --bold $symbol_color + printf "%s " $prompt_symbol + + # Reset colours + set_color normal +end \ No newline at end of file