From 7cfdeeda9144f621f350aae62ac61d66fc8cf6ea Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Fri, 1 Nov 2024 17:15:27 -0400 Subject: [PATCH] refactor: use palette definition to avoid repeated hardcoded hex colours --- roles/shell-tweaks/files/starship.toml | 45 ++++++++++++++------------ 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/roles/shell-tweaks/files/starship.toml b/roles/shell-tweaks/files/starship.toml index 95f594c..0209a6a 100644 --- a/roles/shell-tweaks/files/starship.toml +++ b/roles/shell-tweaks/files/starship.toml @@ -1,53 +1,59 @@ -# Marc's env managed block - BEGIN - format = """ [┌─](bold green) ☠️ \ -[](#9A348E)\ +[](color_orange)\ $username$hostname\ $os\ -[](bg:#33658a fg:#9A348E)\ +[](bg:color_blue fg:color_orange)\ $time\ -[](bg:#DA627D fg:#33658a)\ +[](bg:color_green fg:color_blue)\ $directory\ -[](fg:#DA627D bg:#3208e0)\ +[](fg:color_green bg:color_pink)\ $git_branch\ $git_status\ -[](fg:#4208e0 bg:#9A348E)\ +[](fg:color_pink bg:color_red)\ $python\ -[](fg:#9A348E) +[](fg:color_red) [└─ ](bold green) """ # Disable the blank line at the start of the prompt add_newline = false -[python] -style = "bg:#9A348E" -format = '[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)' +palette = 'default' +[palettes.default] +color_blue = '#458588' +color_green = '#98971a' +color_orange = '#d65d0e' +color_pink = '#b16286' +color_red = '#cc241d' + +[python] +style = "bg:color_red" +format = '[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\) )]($style)' # You can also replace your username with a neat symbol like  or disable this # and use the os module below [username] show_always = true -style_user = "bg:#9A348E" -style_root = "bg:#9A348E" +style_user = "bg:color_orange" +style_root = "bg:color_orange" format = '[$user]($style)' disabled = false [hostname] format = '[@$hostname ]($style)' -style = "bg:#9A348E" +style = "bg:color_orange" ssh_only = false # An alternative to the username module which displays a symbol that # represents the current operating system [os] -style = "bg:#9A348E" +style = "bg:color_red" disabled = true # Disabled by default [directory] -style = "bg:#DA627D" +style = "bg:color_green" format = "[ $path ]($style)" truncation_length = 3 truncation_symbol = "…/" @@ -67,16 +73,15 @@ truncation_symbol = "…/" [git_branch] symbol = "" -style = "bg:#4208e0" +style = "bg:color_pink" format = '[ $symbol $branch ]($style)' [git_status] -style = "bg:#4208e0" +style = "bg:color_pink" format = '[$all_status$ahead_behind ]($style)' [time] time_format = "%T" -style = "bg:#33658A" +style = "bg:color_blue" format = '[ $time ]($style)' disabled = false -# Marc's env managed block - END