move $path definition from apply-color* scripts to helper script
This commit is contained in:
@@ -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 @@ 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
|
||||
@@ -22,3 +21,4 @@ if pgrep -x eww >/dev/null -u "$USER"; then
|
||||
fi
|
||||
|
||||
log_success "eww"
|
||||
|
||||
|
||||
@@ -14,4 +14,3 @@ sed -i -E "s/(set -g fetch_color\s+\"#)([0-9a-fA-F]{6})(\")/\1${colorHex}\3/" "$
|
||||
}
|
||||
|
||||
log_success "fastfetch"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -49,3 +49,6 @@ 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"
|
||||
}
|
||||
|
||||
# relative path
|
||||
path=$(dirname "$(readlink -f "$0")")
|
||||
@@ -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,3 +12,4 @@ kvantummanager --set catppuccin-mocha-"$colorName" || {
|
||||
}
|
||||
|
||||
log_success "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
|
||||
@@ -17,3 +16,4 @@ sed -i -E "s/^(gtk-theme=catppuccin-mocha-)[^-]+(-standard\+default)$/\1${colorN
|
||||
nwg-look -a -x
|
||||
|
||||
log_success "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
|
||||
@@ -14,7 +13,7 @@ targetTypes=("os" "session" "status")
|
||||
if ! python3 - "$file" "$colorHex" "${targetTypes[@]}"; then {
|
||||
log_error "Failed to edit ${file}"
|
||||
exit 1
|
||||
} fi <<EOF
|
||||
}; fi <<EOF
|
||||
import json
|
||||
import sys
|
||||
|
||||
@@ -62,3 +61,4 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
|
||||
log_success "oh-my-posh"
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -19,4 +18,3 @@ if pgrep -x "waybar" -u "$USER" >/dev/null; then
|
||||
fi
|
||||
|
||||
log_success "waybar"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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)"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user