starship: adjust to work nicely in both dark and light mode

This commit is contained in:
Daniel Lundin 2024-06-01 12:50:32 +02:00
parent c23152556a
commit 4b9f5f3dc4
No known key found for this signature in database
2 changed files with 19 additions and 77 deletions

View file

@ -1,57 +0,0 @@
#!/usr/bin/fish
# SPDX-License-Identifier: CC0-1.0
if status --is-interactive
set _fishprompt_aid "fish"$fish_pid
set _fishprompt_started 0
# empty if running; or a numeric exit code; or CANCEL
set _fishprompt_postexec ""
functions -c fish_prompt _fishprompt_saved_prompt
set _fishprompt_prompt_count 0
set _fishprompt_disp_count 0
function _fishprompt_start --on-event fish_prompt
set _fishprompt_prompt_count (math $_fishprompt_prompt_count + 1)
# don't use post-exec, because it is called *before* omitted-newline output
if [ -n "$_fishprompt_postexec" ]
printf "\033]133;D;%s;aid=%s\007" "$_fishprompt_postexec" $_fishprompt_aid
end
printf "\033]133;A;aid=%s;cl=m\007" $_fishprompt_aid
end
function fish_prompt
set _fishprompt_disp_count (math $_fishprompt_disp_count + 1)
printf "\033]133;P;k=i\007%b\033]133;B\007" (string join "\n" (_fishprompt_saved_prompt))
set _fishprompt_started 1
set _fishprompt_postexec ""
end
function _fishprompt_preexec --on-event fish_preexec
if [ "$_fishprompt_started" = 1 ]
printf "\033]133;C;\007"
end
set _fishprompt_started 0
end
function _fishprompt_postexec --on-event fish_postexec
set _fishprompt_postexec $status
_fishprompt_start
end
function __fishprompt_cancel --on-event fish_cancel
set _fishprompt_postexec CANCEL
_fishprompt_start
end
function _fishprompt_exit --on-process %self
if [ "$_fishprompt_started" = 1 ]
printf "\033]133;Z;aid=%s\007" $_fishprompt_aid
end
end
if functions -q fish_right_prompt
functions -c fish_right_prompt _fishprompt_saved_right_prompt
function fish_right_prompt
printf "\033]133;P;k=r\007%b\033]133;B\007" (string join "\n" (_fishprompt_saved_right_prompt))
end
end
end

View file

@ -3,9 +3,10 @@
add_newline = true
format = """\
${custom.pwd}\
$fill\
${custom.pwd}\
$line_break\
$hostname\
$directory\
($character)\
"""
@ -13,43 +14,41 @@ $directory\
right_format = """\
$cmd_duration\
$git_branch$git_commit$git_status$git_state\
$hostname\
"""
[hostname]
ssh_only = false
format = " [](fg:#222222)[ $hostname ](italic dimmed bg:#222222 fg:#999999)"
format = "[$hostname](italic bold)"
disabled = false
[time]
disabled = false
format = ' [$time]($style)'
style = "italic dimmed fg:#666666"
format = '[ $time](italic dimmed inverted)'
time_format = '%R'
[custom.pwd]
command = "pwd"
command = "prompt_pwd -D 100"
when = true
format = "[($output)]($style) "
style = "italic dimmed fg:#777777"
format = "[ $output]($style)"
style = "italic dimmed"
[directory]
fish_style_pwd_dir_length = 1
truncation_length = 1
truncate_to_repo = false
truncation_symbol = "…"
style = "italic fg:#88aabb"
style = "italic"
[line_break]
disabled = false
[fill]
symbol = ''
style = 'fg:#333333'
symbol = ''
style = 'dimmed fg:#888888'
[character]
success_symbol = "[%](bold fg:#66cc99)"
error_symbol = "[%](bold red)"
success_symbol = "[%](bold)"
error_symbol = "[](bold red)"
[cmd_duration]
min_time = 500
@ -57,22 +56,22 @@ format = '[󱦟 $duration ](yellow)'
[git_branch]
format = "[$symbol$branch]($style)"
style = "italic bold fg:#00ac73"
style = "italic bold green"
symbol = " "
truncation_length = 16
truncation_symbol = ""
[git_commit]
format = "[ $hash$tag]($style) "
style = "fg:#00d992"
style = "cyan"
[git_state]
style = ""
[git_status]
format = '([$all_status$ahead_behind]($style)) '
format = '([$all_status$ahead_behind]($style))'
style = "fg:#00ac73"
modified = "[ 󰦒](fg:#d1c000)"
deleted = "[ ✘](fg:#b93400)"
untracked = "[ ?](fg:#9c49aa)"
staged = "[ 󰐖](fg:#71a4aa)"
modified = "[ 󰦒](yellow)"
deleted = "[ ✘](red)"
untracked = "[ ?](purple)"
staged = "[ 󰐖](cyan)"