From a6a48cb0419891752a294bfcf433079e0f6fb3c7 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Mon, 12 Jan 2026 00:33:10 +0000 Subject: [PATCH] [starship] Add starship package --- bash/.config/bash/01_exports.bash | 7 +- macos/.config/homebrew/Brewfile | 1 + starship/.config/starship.toml | 134 ++++++++++++++++++++++++++++++ zsh/.config/zsh/01_exports.zsh | 10 ++- 4 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 starship/.config/starship.toml diff --git a/bash/.config/bash/01_exports.bash b/bash/.config/bash/01_exports.bash index fb474e0..8e4f95b 100644 --- a/bash/.config/bash/01_exports.bash +++ b/bash/.config/bash/01_exports.bash @@ -3,4 +3,9 @@ mkdir -p "${XDG_STATE_HOME}"/bash export HISTFILE="${XDG_STATE_HOME}"/bash/history # Prompt -export PS1="\[\e[0;90m\][\[\e[0;37m\]\u\[\e[0;37m\]@\[\e[0;37m\]\H\[\e[0;90m\]] \[\e[0;90m\](\[\e[0;37m\]\W\[\e[0;90m\]) \[\e[0;37m\]\$\[\e[0m\] " +if [ -x $(command -v starship) ]; then + eval "$(starship init bash)" + export STARSHIP_CACHE="${XDG_CACHE_HOME}"/starship +else + export PS1="\[\e[0;90m\][\[\e[0;37m\]\u\[\e[0;37m\]@\[\e[0;37m\]\H\[\e[0;90m\]] \[\e[0;90m\](\[\e[0;37m\]\W\[\e[0;90m\]) \[\e[0;37m\]\$\[\e[0m\] " +fi diff --git a/macos/.config/homebrew/Brewfile b/macos/.config/homebrew/Brewfile index 06b95eb..09decb5 100644 --- a/macos/.config/homebrew/Brewfile +++ b/macos/.config/homebrew/Brewfile @@ -47,6 +47,7 @@ brew "sass/sass/sass" brew "shellcheck" brew "shfmt" brew "smartmontools" +brew "starship" brew "terraform-docs" brew "terraform-local" brew "tflint" diff --git a/starship/.config/starship.toml b/starship/.config/starship.toml new file mode 100644 index 0000000..261d7be --- /dev/null +++ b/starship/.config/starship.toml @@ -0,0 +1,134 @@ +"$schema" = 'https://starship.rs/config-schema.json' + +palette = 'nord' + +format = """ +[](nord10)\ +$os\ +$username[@](bg:nord10 fg:nord0)$hostname\ +[](bg:nord9 fg:nord10)\ +$directory\ +[](bg:nord8 fg:nord9)\ +$git_branch$git_commit$git_state$git_metrics$git_status\ +[](bg:nord7 fg:nord8)\ +$package$c$cmake$cobol$daml$dart$deno$dotnet$elixir$elm$erlang$fennel$gleam\ +$golang$guix_shell$haskell$haxe$helm$java$julia$kotlin$gradle$lua$nim$nodejs\ +$ocaml$opa$perl$php$pulumi$purescript$python$quarto$raku$rlang$red$ruby$rust\ +$scala$solidity$swift$terraform$typst$vlang$vagrant$zig$aws\ +[](bg:bg fg:nord7)\ +$line_break\ +$character +""" + +[os] +disabled = false +format = "[$symbol ]($style)" +style = "fg:nord0 bg:nord10" + +[os.symbols] +Windows = "" +Ubuntu = "󰕈" +SUSE = "" +Raspbian = "󰐿" +Mint = "󰣭" +Macos = "󰀵" +Manjaro = "" +Linux = "󰌽" +Gentoo = "󰣨" +Fedora = "󰣛" +Alpine = "" +Amazon = "" +Android = "" +AOSC = "" +Arch = "󰣇" +Artix = "󰣇" +CentOS = "" +Debian = "󰣚" +Redhat = "󱄛" +RedHatEnterprise = "󱄛" + +[palettes.nord] +nord0 = '#2E3440' +nord1 = '#3B4252' +nord2 = '#434C5E' +nord3 = '#4C566A' +nord4 = '#D8DEE9' +nord5 = '#E5E9F0' +nord6 = '#ECEFF4' +nord7 = '#8FBCBB' +nord8 = '#88C0D0' +nord9 = '#81A1C1' +nord10 = '#5E81AC' +nord11 = '#BF616A' +nord12 = '#D08770' +nord13 = '#EBCB8B' +nord14 = '#A3BE8C' +nord15 = '#B48EAD' + +[aws] +format = '[ $symbol($profile )(\($region\) )]($style)' +style = "fg:nord0 bg:nord7" +symbol = '🅰 ' + +[git_branch] +format = "[ $symbol$branch(:$remote_branch) ]($style)" +symbol = "󰘬 " +style = "fg:nord0 bg:nord8" + +[git_status] +disabled = true + +[package] +format = "[ 󰏗 $version ]($style)" +style = "fg:nord0 bg:nord7" + +# Languages + +[python] +symbol = '󰌠 ' +format = "[ $symbol($version )]($style)" +style = "fg:nord0 bg:nord7" + +[rust] +symbol = ' ' +format = "[ $symbol($version )]($style)" +style = "fg:nord0 bg:nord7" + +[golang] +symbol = 'go' +format = "[ $symbol($version )]($style)" +style = "fg:nord0 bg:nord7" + +[terraform] +symbol = '󰘦 ' +format = "[ $symbol($version )]($style)" +style = "fg:nord0 bg:nord7" +disabled = false + +# MISC +# ==== + +[hostname] +ssh_only = false +style = "fg:nord0 bg:nord10" +format = "[$ssh_symbol$hostname ]($style)" +ssh_symbol = " " + +[shell] +disabled = false + +[username] +show_always = true +format = '[$user]($style)' +style_user = "fg:nord0 bg:nord10" + +[directory] +style = "fg:nord0 bg:nord9" +read_only = " " +format = "[ 󰉋 $path ]($style)[$read_only]($read_only_style)" +read_only_style = "fg:nord0 bold bg:nord9" + +[character] +success_symbol = "[ >](bold green)" +error_symbol = "[ >](bold red)" +vimcmd_symbol = "[  >](bold green)" diff --git a/zsh/.config/zsh/01_exports.zsh b/zsh/.config/zsh/01_exports.zsh index c00cb00..44119ae 100644 --- a/zsh/.config/zsh/01_exports.zsh +++ b/zsh/.config/zsh/01_exports.zsh @@ -6,5 +6,11 @@ SAVEHIST=$HISTSIZE setopt EXTENDED_HISTORY # Prompt -setopt PROMPT_SUBST -export PS1='%F{8}[%F{white}%n@%m%F{8}] (%F{white}%1~%F{8}) %F{yellow}$AWS_PROFILE%F{white} %#%f ' +# Use starship if installed, otherwise use a simple prompt +if [ -x $(command -v starship) ]; then + eval "$(starship init zsh)" + export STARSHIP_CACHE="${XDG_CACHE_HOME}"/starship +else + setopt PROMPT_SUBST + export PS1='%F{8}[%F{white}%n@%m%F{8}] (%F{white}%1~%F{8}) %F{yellow}$AWS_PROFILE%F{white} %#%f ' +fi