From e5889daf0a9797ad1651f1663f6b0579df951aac Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Thu, 31 Oct 2024 14:08:05 +0900 Subject: [PATCH] :lipstick: style starship.rs --- flake.nix | 9 +- homes/common/starship-rs/default.nix | 21 ++ homes/common/starship-rs/gruvbox-rainbow.toml | 184 ++++++++++++++++++ 3 files changed, 210 insertions(+), 4 deletions(-) create mode 100644 homes/common/starship-rs/gruvbox-rainbow.toml diff --git a/flake.nix b/flake.nix index cd2f4b2..7445e88 100644 --- a/flake.nix +++ b/flake.nix @@ -345,10 +345,11 @@ package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; }; name = "JetBrains Mono"; }; - emoji = { - package = pkgs.noto-fonts-emoji; - name = "Noto Color Emoji"; - }; + emoji = config.stylix.fonts.monospace; + # emoji = { + # package = pkgs.noto-fonts-emoji; + # name = "Noto Color Emoji"; + # }; sizes.popups = 15; }; }; diff --git a/homes/common/starship-rs/default.nix b/homes/common/starship-rs/default.nix index 0831b15..05d0064 100644 --- a/homes/common/starship-rs/default.nix +++ b/homes/common/starship-rs/default.nix @@ -5,8 +5,29 @@ ... }: with lib; +with config.lib.stylix.colors.withHashtag; + { programs.starship = { enable = true; + # download presets from : https://starship.rs/presets/ + settings = builtins.fromTOML ((builtins.readFile ./gruvbox-rainbow.toml)) // { + palettes.stylix = { + color_fg0 = base01; + color_terminal_fg = base05; + color_terminal_bg = base00; + color_bg1 = base04; + color_bg2 = base02; + color_bg3 = base03; + color_blue = base0D; + color_aqua = base0C; + color_green = base0B; + color_orange = base0F; + color_purple = base0E; + color_red = base08; + color_yellow = base0A; + }; + }; }; + } diff --git a/homes/common/starship-rs/gruvbox-rainbow.toml b/homes/common/starship-rs/gruvbox-rainbow.toml new file mode 100644 index 0000000..22869d4 --- /dev/null +++ b/homes/common/starship-rs/gruvbox-rainbow.toml @@ -0,0 +1,184 @@ +"$schema" = 'https://starship.rs/config-schema.json' + +format = """ +$os\ +$username\ +$hostname \ +[](bg:color_yellow fg:color_terminal_bg)\ +$directory\ +[](fg:color_yellow bg:color_aqua)\ +$git_branch\ +$git_status\ +[](fg:color_aqua bg:color_blue)\ +$c\ +$rust\ +$golang\ +$nodejs\ +$php\ +$java\ +$kotlin\ +$haskell\ +$python\ +[](fg:color_blue bg:color_bg3)\ +$docker_context\ +$conda\ +[](fg:color_bg3 bg:color_bg1)\ +$time\ +[ ](fg:color_bg1)\ +$character""" + +palette = 'stylix' # we use stylix instead of gruvbox_dark + +# todo : use stylix/base16 scheme +[palettes.gruvbox_dark] +color_fg0 = '#fbf1c7' +color_terminal_bg = '#fbf1c7' # original background +color_terminal_fg = '#3c3836' # original foreground +color_bg1 = '#3c3836' +color_bg2 = '#665c54' +color_bg3 = '#665c54' +color_blue = '#458588' +color_aqua = '#689d6a' +color_green = '#98971a' +color_orange = '#d65d0e' +color_purple = '#b16286' +color_red = '#cc241d' +color_yellow = '#d79921' + +[os] +disabled = false +style = "bold bg:color_blue fg:color_terminal_bg" +#format = "[$symbol ]($style)" +format = "[](color_blue)[$symbol ]($style)[ ](fg:color_blue bg:color_terminal_bg)" + + +[os.symbols] +Alpine = "" +Amazon = "" +Android = "" +Arch = "󰣇" +Artix = "󰣇" +CentOS = "" +Debian = "󰣚" +EndeavourOS = "" +Fedora = "󰣛" +Gentoo = "󰣨" +Linux = "󰌽" +Macos = "󰀵" +Manjaro = "" +Mint = "󰣭" +NixOS = "" +Pop = "" +Raspbian = "󰐿" +RedHatEnterprise = "󱄛" +Redhat = "󱄛" +SUSE = "" +Ubuntu = "󰕈" +Windows = "󰍲" + +[username] +show_always = true +style_user = "bg:color_terminal_bg fg:color_terminal_fg" +style_root = "bg:color_terminal_bg fg:color_red bold" +format = '[$user]($style)' + +[hostname] +ssh_only = true +style = "bg:color_terminal_bg fg:color_terminal_fg" +ssh_symbol = "@" +format = "[$ssh_symbol$hostname]($style)" + +[directory] +style = "fg:color_fg0 bg:color_yellow" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +[directory.substitutions] +"Documents" = "󰈙 " +"Downloads" = " " +"Music" = "󰝚 " +"Pictures" = " " +"Developer" = "󰲋 " +"dev" = "󰲋 " + +[git_branch] +symbol = "" +style = "bg:color_aqua" +format = '[[ $symbol $branch ](fg:color_fg0 bg:color_aqua)]($style)' + +[git_status] +style = "bg:color_aqua" +format = '[[($all_status$ahead_behind )](fg:color_fg0 bg:color_aqua)]($style)' + +[nodejs] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[c] +symbol = " " +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[rust] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[golang] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[php] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[java] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[kotlin] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[haskell] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[python] +symbol = "" +style = "bg:color_blue" +format = '[[ $symbol( $version) ](fg:color_fg0 bg:color_blue)]($style)' + +[docker_context] +symbol = "" +style = "bg:color_bg3" +format = '[[ $symbol( $context) ](fg:color_fg0 bg:color_bg3)]($style)' + +[conda] +style = "bg:color_bg3" +format = '[[ $symbol( $environment) ](fg:color_fg0 bg:color_bg3)]($style)' + +[time] +disabled = false +time_format = "%R" +style = "bg:color_bg1" +format = '[[  $time ](fg:color_fg0 bg:color_bg1)]($style)' + +[line_break] +disabled = false + +[character] +disabled = false +success_symbol = "[](fg:color_bg2)[ ](bold fg:color_terminal_fg bg:color_bg2)[](fg:color_bg2)" +error_symbol = "[](fg:color_bg2)[ ](bold fg:color_red bg:color_bg2)[](fg:color_bg2)" +vimcmd_symbol = '[](bold fg:color_green)' +vimcmd_replace_one_symbol = '[](bold fg:color_purple)' +vimcmd_replace_symbol = '[](bold fg:color_purple)' +vimcmd_visual_symbol = '[](bold fg:color_yellow)'