From 5535792e4235a083606fa15bad0de4999b771697 Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Wed, 30 Apr 2025 10:05:55 -0400 Subject: [PATCH 1/5] starship updates --- .../private_dot_config/starship.toml.tmpl | 1 + .../remove_starship.toml.old | 122 ++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 120000 chezmoi.roots/_home.macos/private_dot_config/starship.toml.tmpl create mode 100644 chezmoi.roots/_src.all/private_dot_config/remove_starship.toml.old diff --git a/chezmoi.roots/_home.macos/private_dot_config/starship.toml.tmpl b/chezmoi.roots/_home.macos/private_dot_config/starship.toml.tmpl new file mode 120000 index 0000000..fcd3787 --- /dev/null +++ b/chezmoi.roots/_home.macos/private_dot_config/starship.toml.tmpl @@ -0,0 +1 @@ +../../_home/private_dot_config/starship.toml.tmpl \ No newline at end of file diff --git a/chezmoi.roots/_src.all/private_dot_config/remove_starship.toml.old b/chezmoi.roots/_src.all/private_dot_config/remove_starship.toml.old new file mode 100644 index 0000000..e29f145 --- /dev/null +++ b/chezmoi.roots/_src.all/private_dot_config/remove_starship.toml.old @@ -0,0 +1,122 @@ +# Customized, based on tokyo-night + +# {{/* pallette definition */}} +# {{- $theme := dict }} +# {{- with $_ := set $theme "gradient_a" "#090c0c" }}{{ end -}} +# {{- with $_ := set $theme "gradient_b" "#a3aed2" }}{{ end -}} +# {{- with $_ := set $theme "gradient_c" "#769ff0" }}{{ end -}} +# {{- with $_ := set $theme "gradient_d" "#e3e5e5" }}{{ end -}} +# {{- with $_ := set $theme "gradient_e" "# " }}{{ end -}} +# {{- with $_ := set $theme "gradient_f" "#394260" }}{{ end -}} +# {{- with $_ := set $theme "gradient_g" "#212736" }}{{ end -}} +# {{- with $_ := set $theme "gradient_h" "#1d2230" }}{{ end -}} +# {{- with $_ := set $theme "gradient_i" "# " }}{{ end -}} + +# global prompt configuration ( https://starship.rs/config/#prompt ) +format = """ +[░▒▓](#a3aed2)\ +$os\ +[](bg:#769ff0 fg:#a3aed2)\ +$directory\ +[](fg:#769ff0 bg:#394260)\ +$git_branch\ +$git_status\ +[](fg:#394260 bg:#212736)\ +$nodejs\ +$rust\ +$golang\ +[](fg:#212736 bg:#1d2230)\ +$time\ +[](fg:#212736 bg:#1d2230)\ +$cmd_duration\ +$status\ +[ ](fg:#1d2230)\ +$line_break$character""" + +command_timeout = 1500 # milliseconds; default is 500 + +[profiles] +transient = """ +$time\ +[](fg:#212736 bg:#1d2230)\ +$character""" + + +[os] +style = "bg:#a3aed2 fg:#090c0c" +disabled = false + +# Without NerdFont +#[os.symbols] +#Windows = " Win" + +# NerdFont - see https://www.nerdfonts.com/cheat-sheet +[os.symbols] +Windows = " " + +[directory] +style = "fg:#e3e5e5 bg:#769ff0" +format = "[ $path ]($style)" +truncation_length = 3 +truncation_symbol = "…/" + +[directory.substitutions] +"Documents" = "󰈙 " +"Downloads" = " " +"Music" = " " +"Pictures" = " " + +[custom.chezmoi] +symbol = "🏠" +style = "bg:#394260" +command = "chezmoi status | wc -l" +when = true +format = '[[ $output $symbol ](fg:#769ff0 bg:#394260)]($style)' + +[git_branch] +symbol = "" +style = "bg:#394260" +format = '[[ $symbol $branch ](fg:#769ff0 bg:#394260)]($style)' + +[git_status] +style = "bg:#394260" +format = '[[($all_status$ahead_behind )](fg:#769ff0 bg:#394260)]($style)' + +[nodejs] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[rust] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[golang] +symbol = "" +style = "bg:#212736" +format = '[[ $symbol ($version) ](fg:#769ff0 bg:#212736)]($style)' + +[time] +disabled = false +time_format = "%R" # Hour:Minute Format +style = "bg:#1d2230" +format = '[[  $time ](fg:#a0a9cb bg:#1d2230)]($style)' + +[cmd_duration] +min_time = 500 # milliseconds +# nerd font version: +format = 'prev: [[  $duration ](fg:#a0a9cb bg:#1d2230)]($style)' +# General UNICODE font version: +# format = '[[ ⧗ $duration ](fg:#a0a9cb bg:#1d2230)]($style)' +# Emoji version: +# format = '[[ ⌛ $duration ](fg:#a0a9cb bg:#1d2230)]($style)' + +[status] +disabled = false + +[character] +disabled = false + +# vim: set ft=toml expandtab tabstop=2 shiftwidth=2: + From 2af30b88c0647e690ed3e0e3c86b190454faab56 Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Wed, 30 Apr 2025 10:06:30 -0400 Subject: [PATCH 2/5] safer atuin daemon init (was breaking on MacOS) --- .../_home/private_dot_config/sz.env/980_atuin_daemon.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chezmoi.roots/_home/private_dot_config/sz.env/980_atuin_daemon.env b/chezmoi.roots/_home/private_dot_config/sz.env/980_atuin_daemon.env index 42b2a42..a9f35f0 100644 --- a/chezmoi.roots/_home/private_dot_config/sz.env/980_atuin_daemon.env +++ b/chezmoi.roots/_home/private_dot_config/sz.env/980_atuin_daemon.env @@ -10,7 +10,7 @@ if is_cmd atuin; then # communicate with the running daemon rather than attempting direct database access. # The setup-atuin-daemon.sh script should be run on ZFS systems to create and # start the systemd service for the daemon. - if pgrep -f "atuin daemon" > /dev/null; then + if pgrep -f "atuin daemon" > /dev/null && [ -d "$HOME/.config/atuin/with-daemon" ]; then export ATUIN_CONFIG_DIR="$HOME/.config/atuin/with-daemon" fi From 08e00b05f60b7ff3c0385f2249d79c971e1ede10 Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Wed, 30 Apr 2025 10:07:53 -0400 Subject: [PATCH 3/5] fix: zellij cleanup when TMPDIR is used --- .../_home/private_dot_local/bin/executable_load-zellij | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij b/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij index 6802fee..1286afb 100644 --- a/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij +++ b/chezmoi.roots/_home/private_dot_local/bin/executable_load-zellij @@ -20,7 +20,7 @@ if is_sourced; then && ${SUDO:-} rm -fR "$HOME/.cache/zellij" [[ -d "$HOME/Library/Caches/org.Zellij-Contributors.Zellij" ]] \ && ${SUDO:-} rm -fR "$HOME/Library/Caches/org.Zellij-Contributors.Zellij" - find /tmp -maxdepth 1 -mindepth 1 -type d -name 'zellij*' -print0 | ${SUDO:-} xargs -r0t rm -fR + find ${TMPDIR:-/tmp} -maxdepth 1 -mindepth 1 -type d -name 'zellij*' -print0 | ${SUDO:-} xargs -r0t rm -fR if [[ -d "$HOME/.cache/zellij" || -d "$HOME/Library/Caches/org.Zellij-Contributors.Zellij" ]]; then printf 'Zellij cleanup failed to remove the cache directory, you might still have a zellij session active.\n' else @@ -33,10 +33,10 @@ ${SET_X-:} -x local bin_path=~/.local/bin/zellij local cached_path=~/.cache/chezmoi/tmp/zellij if [ -z "$(command -v zellij)" ] && [ -x "${cached_path}" ]; then - printf "Grabbing zellij from the web!\n" + printf "Grabbing zellij from the cache!\n" cp "${cached_path}" "${bin_path}" fi - local cached_path=/tmp/zellij/bootstrap/zellij + local cached_path=${TMPDIR:-/tmp}/zellij/bootstrap/zellij if [ -z "$(env which zellij)" ] && ! [ -x "${bin_path}" ]; then if [[ ! -r "${cached_path}" ]]; then printf "Grabbing zellij from the web!\n" @@ -44,7 +44,7 @@ ${SET_X-:} -x fi if [[ -r "${cached_path}" ]]; then mv "${cached_path}" "${bin_path}" - rm -fR /tmp/zellij + rm -fR ${TMPDIR:-/tmp}/zellij fi fi refresh-zellij() { :; } From 5f12d8650ee58469cc72cec00626a36a28990514 Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Wed, 30 Apr 2025 12:36:12 -0400 Subject: [PATCH 4/5] fix cz-reset-home --- .../_home/private_dot_config/sz.env/981_chezmoi.env.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chezmoi.roots/_home/private_dot_config/sz.env/981_chezmoi.env.tmpl b/chezmoi.roots/_home/private_dot_config/sz.env/981_chezmoi.env.tmpl index 79dfffa..0c0d668 100644 --- a/chezmoi.roots/_home/private_dot_config/sz.env/981_chezmoi.env.tmpl +++ b/chezmoi.roots/_home/private_dot_config/sz.env/981_chezmoi.env.tmpl @@ -52,7 +52,7 @@ if is_cmd 'chezmoi'; then alias czu="czg pull && cz init --verbose && cz apply --verbose && _r" alias czxu="cz upgrade && czg pull && cz init --verbose && czx apply --verbose && _r" - alias cz-reset-home="(czgcd && cd chezmoi.roots && RESET=reset SRC_DIR=_src.all ./symclone _home && RESET=reset ./symclone.sh _home.macos)" + alias cz-reset-home="(czgcd && cd chezmoi.roots && RESET=reset SRC_DIR=_src.all ./symclone.sh _home && RESET=reset ./symclone.sh _home.macos)" fi # vim: set ft=sh sw=4 sts=4 et: From 20c365d7f4af987e0ebd67a00afb6032ae121bfa Mon Sep 17 00:00:00 2001 From: "Lockszmith (VAST@MacBook)" Date: Wed, 30 Apr 2025 12:37:51 -0400 Subject: [PATCH 5/5] optimize pager and cat alias setup for bat+ov, ov, bat or moar --- .../private_dot_config/sz.env/991_pager.env | 1 + .../sz.env/991_aliases.env.tmpl | 12 ---------- .../private_dot_config/sz.env/991_pager.env | 22 +++++++++++++++++++ 3 files changed, 23 insertions(+), 12 deletions(-) create mode 120000 chezmoi.roots/_home.macos/private_dot_config/sz.env/991_pager.env create mode 100644 chezmoi.roots/_home/private_dot_config/sz.env/991_pager.env diff --git a/chezmoi.roots/_home.macos/private_dot_config/sz.env/991_pager.env b/chezmoi.roots/_home.macos/private_dot_config/sz.env/991_pager.env new file mode 120000 index 0000000..613c88f --- /dev/null +++ b/chezmoi.roots/_home.macos/private_dot_config/sz.env/991_pager.env @@ -0,0 +1 @@ +../../../_home/private_dot_config/sz.env/991_pager.env \ No newline at end of file diff --git a/chezmoi.roots/_home/private_dot_config/sz.env/991_aliases.env.tmpl b/chezmoi.roots/_home/private_dot_config/sz.env/991_aliases.env.tmpl index adebcc1..5b107b5 100644 --- a/chezmoi.roots/_home/private_dot_config/sz.env/991_aliases.env.tmpl +++ b/chezmoi.roots/_home/private_dot_config/sz.env/991_aliases.env.tmpl @@ -17,18 +17,6 @@ alias lu='l -U ' alias sudo='sudo ' -is_cmd ov \ -&& alias less="ov --wrap=false " \ -&& export PAGER="ov --wrap=false " - -if is_cmd bat; then - alias less='bat --wrap=never --style=plain ' - alias cat='bat --wrap=never ' -elif is_cmd moar; then - alias less="moar " \ - && export PAGER=moar -fi - is_cmd nvim \ && export VISUAL="nvim" EDITOR="nvim" \ || export VISUAL="vim" EDITOR="vim" diff --git a/chezmoi.roots/_home/private_dot_config/sz.env/991_pager.env b/chezmoi.roots/_home/private_dot_config/sz.env/991_pager.env new file mode 100644 index 0000000..f3a624f --- /dev/null +++ b/chezmoi.roots/_home/private_dot_config/sz.env/991_pager.env @@ -0,0 +1,22 @@ +#!/usr/bin/env -S bash -c 'echo "Not a user script. source(aka .) only"' +if is_cmd moar; then + alias less="moar " + export PAGER=moar + alias cat='moar -quit-if-one-screen ' +fi + +if is_cmd ov; then + . <( ov completion "${SHELL##*/}" ) + alias less="ov --wrap=false " + export PAGER="ov --wrap=false " + BAT_CAT_PAGER="${PAGER} --quit-if-one-screen" +fi +alias cat="${BAT_CAT_PAGER:-${PAGER}} " + +if is_cmd bat; then + alias less='bat --wrap=never --style=plain ' + alias cat="bat --wrap=never --paging=auto --pager='${BAT_CAT_PAGER:-${PAGER}}' " +fi + +# vim: set ft=sh expandtab tabstop=4 shiftwidth=4: +