From 94be67bf43973170b1f9dc1203321ee88fcaa604 Mon Sep 17 00:00:00 2001 From: Uyanide Date: Sat, 15 Nov 2025 02:00:43 +0100 Subject: [PATCH] move $path definition from apply-color* scripts to helper script --- config/eww/.config/eww/apply-color | 6 +++--- config/fastfetch/.config/fastfetch/apply-color | 1 - config/fuzzel/.config/fuzzel/apply-color | 2 -- config/hypr/.config/hypr/apply-color | 2 -- config/mako/.config/mako/apply-color | 2 -- config/niri/.config/niri/apply-color | 2 -- config/quickshell/.config/quickshell/apply-color | 2 -- config/rofi/.config/rofi/apply-color | 2 -- config/scripts/.local/snippets/apply-color-helper | 5 ++++- config/shell/.config/fish/apply-color-kvantum | 4 ++-- config/shell/.config/fish/apply-color-nwg-look | 4 ++-- config/shell/.config/fish/apply-color-omp | 6 +++--- config/waybar/.config/waybar/apply-color | 2 -- config/wlogout/.config/.alt/wlogout-default/apply-color | 2 -- config/wlogout/.config/.alt/wlogout-niri/apply-color | 2 -- config/yazi/.config/yazi/apply-color | 2 -- 16 files changed, 14 insertions(+), 32 deletions(-) diff --git a/config/eww/.config/eww/apply-color b/config/eww/.config/eww/apply-color index bc58a3d..242ca2f 100755 --- a/config/eww/.config/eww/apply-color +++ b/config/eww/.config/eww/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -14,11 +13,12 @@ sed -i "s|^\$border: #[0-9a-fA-F]\{6\};\$|\$border: #${colorHex};|" "$file" || { exit 1 } -if pgrep -x eww >/dev/null -u "$USER"; then +if pgrep -x eww -u "$USER" >/dev/null; then eww reload || { log_error "Failed to reload eww, is it running?" exit 1 } fi -log_success "eww" \ No newline at end of file +log_success "eww" + diff --git a/config/fastfetch/.config/fastfetch/apply-color b/config/fastfetch/.config/fastfetch/apply-color index 219e52b..5c6767e 100755 --- a/config/fastfetch/.config/fastfetch/apply-color +++ b/config/fastfetch/.config/fastfetch/apply-color @@ -14,4 +14,3 @@ sed -i -E "s/(set -g fetch_color\s+\"#)([0-9a-fA-F]{6})(\")/\1${colorHex}\3/" "$ } log_success "fastfetch" - diff --git a/config/fuzzel/.config/fuzzel/apply-color b/config/fuzzel/.config/fuzzel/apply-color index d09cdf4..d379177 100755 --- a/config/fuzzel/.config/fuzzel/apply-color +++ b/config/fuzzel/.config/fuzzel/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -24,4 +23,3 @@ for entry in $entries; do done log_success "fuzzel" - diff --git a/config/hypr/.config/hypr/apply-color b/config/hypr/.config/hypr/apply-color index 711b9d9..c6246ec 100755 --- a/config/hypr/.config/hypr/apply-color +++ b/config/hypr/.config/hypr/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -27,4 +26,3 @@ if pgrep -x "hyprland" -u "$USER" >/dev/null; then fi log_success "hyprland" - diff --git a/config/mako/.config/mako/apply-color b/config/mako/.config/mako/apply-color index d3c7d55..4386e8f 100755 --- a/config/mako/.config/mako/apply-color +++ b/config/mako/.config/mako/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -23,4 +22,3 @@ if pgrep -x "mako" -u "$USER" >/dev/null; then fi log_success "mako" - diff --git a/config/niri/.config/niri/apply-color b/config/niri/.config/niri/apply-color index 2e713ae..58aa7e8 100755 --- a/config/niri/.config/niri/apply-color +++ b/config/niri/.config/niri/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -15,4 +14,3 @@ sed -i -E "s/^(\s*active-color\s+\"#)([0-9A-Fa-f]{6})(\")/\1${colorHex}\3/" "$fi } log_success "niri" - diff --git a/config/quickshell/.config/quickshell/apply-color b/config/quickshell/.config/quickshell/apply-color index ab15d41..1958de4 100755 --- a/config/quickshell/.config/quickshell/apply-color +++ b/config/quickshell/.config/quickshell/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -18,4 +17,3 @@ else log_error "quickshell is not running. Cannot apply color." exit 1 fi - diff --git a/config/rofi/.config/rofi/apply-color b/config/rofi/.config/rofi/apply-color index 044378c..1ef6d40 100755 --- a/config/rofi/.config/rofi/apply-color +++ b/config/rofi/.config/rofi/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -20,4 +19,3 @@ sed -i -E "s/^(\s*primary:\s*#)([0-9A-Fa-f]{6})(;)/\1${colorHex}\3/" "$file" || } log_success "rofi" - diff --git a/config/scripts/.local/snippets/apply-color-helper b/config/scripts/.local/snippets/apply-color-helper index 91d50c0..2eecd0e 100644 --- a/config/scripts/.local/snippets/apply-color-helper +++ b/config/scripts/.local/snippets/apply-color-helper @@ -48,4 +48,7 @@ function color_ansi { function log_success { log_info "Applied palette \033[1;34m${palette}\033[0m with primary color $(color_ansi $colorHex)${colorName} (#${colorHex})\033[0m to \033[1;34m$1\033[0m" -} \ No newline at end of file +} + +# relative path +path=$(dirname "$(readlink -f "$0")") \ No newline at end of file diff --git a/config/shell/.config/fish/apply-color-kvantum b/config/shell/.config/fish/apply-color-kvantum index fd6dbb9..e2688ee 100755 --- a/config/shell/.config/fish/apply-color-kvantum +++ b/config/shell/.config/fish/apply-color-kvantum @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -12,4 +11,5 @@ kvantummanager --set catppuccin-mocha-"$colorName" || { exit 1 } -log_success "kvantum" \ No newline at end of file +log_success "kvantum" + diff --git a/config/shell/.config/fish/apply-color-nwg-look b/config/shell/.config/fish/apply-color-nwg-look index e015995..70a96f9 100755 --- a/config/shell/.config/fish/apply-color-nwg-look +++ b/config/shell/.config/fish/apply-color-nwg-look @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -16,4 +15,5 @@ sed -i -E "s/^(gtk-theme=catppuccin-mocha-)[^-]+(-standard\+default)$/\1${colorN nwg-look -a -x -log_success "nwg-look" \ No newline at end of file +log_success "nwg-look" + diff --git a/config/shell/.config/fish/apply-color-omp b/config/shell/.config/fish/apply-color-omp index f80bacc..4d3767d 100755 --- a/config/shell/.config/fish/apply-color-omp +++ b/config/shell/.config/fish/apply-color-omp @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -14,7 +13,7 @@ targetTypes=("os" "session" "status") if ! python3 - "$file" "$colorHex" "${targetTypes[@]}"; then { log_error "Failed to edit ${file}" exit 1 -} fi </dev/null; then fi log_success "waybar" - diff --git a/config/wlogout/.config/.alt/wlogout-default/apply-color b/config/wlogout/.config/.alt/wlogout-default/apply-color index b2bbec6..2504ad4 100755 --- a/config/wlogout/.config/.alt/wlogout-default/apply-color +++ b/config/wlogout/.config/.alt/wlogout-default/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -23,4 +22,3 @@ sed -i -E "s/(border-color:\s*#)([0-9A-Fa-f]{6})(;)/\1${colorHex}\3/" "$file" || } log_success "wlogout" - diff --git a/config/wlogout/.config/.alt/wlogout-niri/apply-color b/config/wlogout/.config/.alt/wlogout-niri/apply-color index fbfee15..667d85d 100755 --- a/config/wlogout/.config/.alt/wlogout-niri/apply-color +++ b/config/wlogout/.config/.alt/wlogout-niri/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -23,4 +22,3 @@ sed -i -E "s/(border-color:\s*#)([0-9A-Fa-f]{6})(;)/\1${colorHex}\3/" "$file" || } log_success "wlogout (niri version)" - diff --git a/config/yazi/.config/yazi/apply-color b/config/yazi/.config/yazi/apply-color index 1921629..5b10998 100755 --- a/config/yazi/.config/yazi/apply-color +++ b/config/yazi/.config/yazi/apply-color @@ -1,6 +1,5 @@ #!/bin/bash -path=$(dirname "$(readlink -f "$0")") [ -f "$HOME/.local/snippets/apply-color-helper" ] || { echo "Missing helper script: $HOME/.local/snippets/apply-color-helper" exit 1 @@ -13,4 +12,3 @@ cp -f "$path"/../../../../assets/yazi-themes/catppuccin-mocha-"$colorName".toml } log_success "yazi" -