Left shell prompt
This commit is contained in:
parent
2ec91514e5
commit
355ae2f348
51
conf.d/30_prompt.fish
Normal file
51
conf.d/30_prompt.fish
Normal file
@ -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
|
||||||
Loading…
x
Reference in New Issue
Block a user