mirror of
https://github.com/lowne/fish-prompt-metro.git
synced 2024-10-27 20:34:12 +00:00
add dark/light mode via is_dark_mode
function, if defined; add clock on right prompt if fish_right_prompt_show_clock
is defined
This commit is contained in:
parent
8945e30794
commit
e61c7cee2a
@ -3,7 +3,25 @@ function fish_prompt
|
||||
set -l pwd_info (pwd_info "/")
|
||||
set -l dir
|
||||
set -l base
|
||||
set -l base_color 888 161616
|
||||
|
||||
set -l dark_mode 1 #default to dark mode
|
||||
set -l base_color
|
||||
set -l text_color
|
||||
set -l split_color
|
||||
|
||||
if functions -q is_dark_mode
|
||||
is_dark_mode; or set -e dark_mode
|
||||
end
|
||||
if set -lq dark_mode
|
||||
set base_color BBB 333
|
||||
set text_color FFF
|
||||
# set split_color 000
|
||||
else
|
||||
set base_color 555 DDD
|
||||
set text_color 000
|
||||
# set split_color FFF
|
||||
end
|
||||
set split_color $base_color[2]
|
||||
|
||||
if test "$PWD" = ~
|
||||
set base "~"
|
||||
@ -66,14 +84,14 @@ function fish_prompt
|
||||
|
||||
if set -q git_color[3]
|
||||
segment "$git_color[3]" "$git_color[4]" "$prompt"
|
||||
segment black black
|
||||
segment $split_color $split_color
|
||||
segment "$git_color[1]" "$git_color[2]" " $git_glyph "
|
||||
else
|
||||
segment "$git_color[1]" "$git_color[2]" "$prompt"
|
||||
end
|
||||
end
|
||||
|
||||
segment $base_color " $dir"(set_color white)"$base "
|
||||
segment $base_color " $dir"(set_color $text_color)"$base "
|
||||
|
||||
if test ! -z "$SSH_CLIENT"
|
||||
set -l color bbb 222
|
||||
|
@ -1,7 +1,14 @@
|
||||
function fish_right_prompt
|
||||
set -l status_copy $status
|
||||
set -l status_code $status_copy
|
||||
set -l status_color 555
|
||||
|
||||
set -l dark_mode 1 #default to dark mode
|
||||
if functions -q is_dark_mode
|
||||
is_dark_mode; or set -e dark_mode
|
||||
end
|
||||
|
||||
set -l status_color 333; set -lq dark_mode; or set status_color DDD
|
||||
|
||||
set -l status_glyph
|
||||
set -l duration_glyph
|
||||
|
||||
@ -34,6 +41,7 @@ function fish_right_prompt
|
||||
set status_glyph ┃
|
||||
end
|
||||
end
|
||||
|
||||
echo -sn (set_color $status_color) "$status_glyph" (set_color normal)
|
||||
echo -sn (set_color $status_color)
|
||||
set -q fish_right_prompt_show_clock; and echo -sn (date "+%H:%M:%S")" "
|
||||
echo -sn "$status_glyph" (set_color normal)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user