From dade3f53f23626545ea0a195ffa435791acc81bf Mon Sep 17 00:00:00 2001 From: agryphus Date: Mon, 8 Jan 2024 23:23:33 -0500 Subject: [PATCH] Dynamic accent color --- .config/colors/accent | 1 + .config/starship.toml | 73 ++++++++++++++++++++++++++++++++++++++++++ .local/bin/menu-accent | 14 ++++++++ 3 files changed, 88 insertions(+) create mode 100644 .config/colors/accent create mode 100644 .config/starship.toml create mode 100755 .local/bin/menu-accent diff --git a/.config/colors/accent b/.config/colors/accent new file mode 100644 index 0000000..24560d9 --- /dev/null +++ b/.config/colors/accent @@ -0,0 +1 @@ +blue diff --git a/.config/starship.toml b/.config/starship.toml new file mode 100644 index 0000000..97907f9 --- /dev/null +++ b/.config/starship.toml @@ -0,0 +1,73 @@ +# Use starship.def.toml to edit the starship configuration. There should be an entr daemon +# running which, upon changes to the file, will replace each instance of blue with +# the appropriate environment variable. This hack was cobbled together because starship currently +# does not allow environment variables to be used as a style (which is dumb) + +# Inserts a blank line between shell prompts +add_newline = false + +format = '''[╭──\([$username@$hostname](bold blue)\)-\[$directory\](-\[$git_branch$git_metrics$git_status\])(-\[$nix_shell\])](blue) $cmd_duration +[╰─](blue)[$shell](bold blue) ''' +# format = ''' +# [\[$directory\](-\[$git_branch$git_metrics$git_status\])(-\[$nix_shell\])](blue)[λ ](blue bold) +# ''' +right_format = '$status' + +[line_break] +disabled = false + +[username] +format = '$user' +disabled = false +show_always = true + +[nix_shell] +symbol = '❄️' +format = '[$symbol$name](bold purple)' + +[hostname] +ssh_only = false +format = '[$ssh_symbol](bold blue)$hostname' +trim_at = '.companyname.com' +disabled = false + +[git_branch] +style = 'bold green' +symbol = '' +format = '[$symbol$branch(hello$banch)](bold green)' + +[git_status] +modified = '[✘](bold red)' +up_to_date = 'up' +format = '$up_to_date$modified$up_to_date' + +[directory] +truncation_length = 3 +truncation_symbol = '…/' +truncate_to_repo = true +style = 'bold white' +format = '[$path]($style)[$read_only]($read_only_style)' + +[character] +success_symbol = '[λ](bold blue)' +error_symbol = '[λ](bold red)' +# success_symbol = '[❯](bold blue)' +# error_symbol = '[❯](bold red)' + +[cmd_duration] +min_time = 1_000 +style = "bold dimmed yellow" +format = '◷[$duration]($style) ' + +[shell] +fish_indicator = '󰈺' +powershell_indicator = '_' +bash_indicator = '\$' +zsh_indicator = 'λ' +unknown_indicator = '?' +disabled = false +format = '$indicator' + +[status] +disabled = false + diff --git a/.local/bin/menu-accent b/.local/bin/menu-accent new file mode 100755 index 0000000..16a1d8e --- /dev/null +++ b/.local/bin/menu-accent @@ -0,0 +1,14 @@ +#!/usr/bin/env zsh + +accent=$(echo "black +red +green +yellow +blue +purple +cyan +white" | rofi -no-fixed-num-lines -dmenu -p "Choose an accent color:") +[ -z "$accent" ] && exit 0 +echo "$accent" > ~/.config/colors/accent +source ~/.config/zsh/.zshrc +