From 4b9f5f3dc4ba707bb9cf141e8bd18419c08f3769 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Sat, 1 Jun 2024 12:50:32 +0200 Subject: [PATCH] starship: adjust to work nicely in both dark and light mode --- .config/fish/conf.d/semantic-prompt.fish | 57 ------------------------ .config/starship.toml | 39 ++++++++-------- 2 files changed, 19 insertions(+), 77 deletions(-) delete mode 100644 .config/fish/conf.d/semantic-prompt.fish diff --git a/.config/fish/conf.d/semantic-prompt.fish b/.config/fish/conf.d/semantic-prompt.fish deleted file mode 100644 index 296a561..0000000 --- a/.config/fish/conf.d/semantic-prompt.fish +++ /dev/null @@ -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 diff --git a/.config/starship.toml b/.config/starship.toml index 03ad822..f983e5f 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -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)"