From 68e96ca7399f627c15dbb1e32b4cc4435877986a Mon Sep 17 00:00:00 2001 From: caandt Date: Wed, 25 Dec 2024 14:25:12 -0500 Subject: [PATCH] starship config --- user/config/bash/custom | 2 +- user/config/default.nix | 2 +- user/config/starship.toml | 46 ------------------------ user/config/starship/default.nix | 62 ++++++++++++++++++++++++++++++++ 4 files changed, 64 insertions(+), 48 deletions(-) delete mode 100644 user/config/starship.toml create mode 100644 user/config/starship/default.nix diff --git a/user/config/bash/custom b/user/config/bash/custom index 8593c52..9da3f0c 100644 --- a/user/config/bash/custom +++ b/user/config/bash/custom @@ -51,9 +51,9 @@ if [[ "$TERM" != "linux" ]]; then printf "\e]0;%s | %s | %s\a" "$(dirs +0)" "$@" "$(date +"%H:%M:%S")" fi } - _exists starship && eval "$(starship init bash)" # set window title after running command trap "$(trap -p DEBUG | awk -F"'" '{print $2 ";"}')_set_win_title \"\${BASH_COMMAND}\"" DEBUG + _exists starship && eval "$(starship init bash)" else # [username pwd] green $ reset PS1="[\u \W] \[\e[32;1m\]\$\[\e[0m\] " diff --git a/user/config/default.nix b/user/config/default.nix index d2fc861..7ad776d 100644 --- a/user/config/default.nix +++ b/user/config/default.nix @@ -10,6 +10,7 @@ in { ./kde ./tmux ./nvim + ./starship ]; fonts.fontconfig.enable = false; @@ -33,6 +34,5 @@ in { xdg.configFile.python.source = ./python; xdg.configFile.qt5ct.source = ./qt5ct; xdg.configFile.readline.source = ./readline; - xdg.configFile."starship.toml".source = ./starship.toml; xdg.configFile.sx.source = ln "sx"; } diff --git a/user/config/starship.toml b/user/config/starship.toml deleted file mode 100644 index ef984ab..0000000 --- a/user/config/starship.toml +++ /dev/null @@ -1,46 +0,0 @@ -format = """ -[ ](bg:#E34F7C)\ -$username\ -$directory\ -$git_branch\ -$git_commit\ -$git_state\ -$git_metrics\ -$git_status\ -$cmd_duration\ -$line_break\ -$jobs\ -$shlvl\ -$status\ -$nix_shell\ -$character""" - -[status] -disabled = false -symbol = "x" - -[character] -success_symbol = '[\$](bold green)' -error_symbol = '[\$](bold red)' - -[fill] -symbol = " " - -[username] -show_always = true -format = "[$user ]($style inverted)[ ]($style bg:#443f59)" -style_user = "#E34F7C" -style_root = "#4571a2 bg:red" - -[directory] -format = "[$path [$read_only]($style bg:red inverted)]($style bg:white inverted)[ ]($style)" -style = "#443f59" -read_only =" " - -[shlvl] -disabled = false -symbol = "#" - -[nix_shell] -format = "[$symbol]($style) " -symbol = "*" diff --git a/user/config/starship/default.nix b/user/config/starship/default.nix new file mode 100644 index 0000000..dc8f1de --- /dev/null +++ b/user/config/starship/default.nix @@ -0,0 +1,62 @@ +{config, lib, ...}: { + programs.starship = { + enable = true; + settings = lib.mkDefault { + format = lib.concatStrings [ + "$username" + "$hostname" + "$directory" + "([\\[ $git_branch" + "$git_commit" + "$git_state" + "$git_metrics" + "$git_status \\]](bold) )" + "$cmd_duration" + "$line_break" + "$jobs" + "$shlvl" + "$status" + "$nix_shell" + "$character" + ]; + palettes = { + default = { + c1 = "#e34f7c"; # red + c2 = "#4571a2"; # blue + c3 = "#443f59"; # purple + }; + }; + palette = "default"; + status = { + disabled = false; + symbol = "x"; + }; + character = { + success_symbol = "[\\$](bold green)"; + error_symbol = "[\\$](bold red)"; + }; + username = { + show_always = true; + format = "[ $user ](c1 inverted)"; + }; + directory = { + format = "[ $path[$read_only](red bg:c3) ](white bg:c3) "; + read_only = " [ro]"; + }; + shlvl = { + disabled = false; + symbol = "#"; + }; + nix_shell = { + format = "[$symbol]($style) "; + symbol = "*"; + }; + git_branch.format = "[$branch(:$remote_branch)]($style) "; + git_status.format = "(| [$all_status$ahead_behind]($style))"; + git_metrics.format = "(| [$added]($added_style)([ $deleted]($deleted_style)) )"; + git_metrics.disabled = false; + cmd_duration.format = "[\\[$duration\\]]($style) "; + hostname.format = "[ @$hostname ](bg:c2)"; + }; + }; +}