From 064520080702a983cb35e832ad30e4f35a41b3a9 Mon Sep 17 00:00:00 2001 From: Eric <51763643+EricL521@users.noreply.github.com> Date: Sun, 7 Dec 2025 21:44:32 -0500 Subject: [PATCH 1/2] Allow persistant accent color --- .../quickshell/ii/modules/common/Config.qml | 1 + .../quickshell/ii/scripts/colors/switchwall.sh | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index 859e336e3..a9b193ccf 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -138,6 +138,7 @@ Singleton { } property JsonObject palette: JsonObject { property string type: "auto" // Allowed: auto, scheme-content, scheme-expressive, scheme-fidelity, scheme-fruit-salad, scheme-monochrome, scheme-neutral, scheme-rainbow, scheme-tonal-spot + property string accentColor: "" } } diff --git a/dots/.config/quickshell/ii/scripts/colors/switchwall.sh b/dots/.config/quickshell/ii/scripts/colors/switchwall.sh index 31f260760..1be85e021 100755 --- a/dots/.config/quickshell/ii/scripts/colors/switchwall.sh +++ b/dots/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -319,6 +319,12 @@ main() { get_type_from_config() { jq -r '.appearance.palette.type' "$SHELL_CONFIG_FILE" 2>/dev/null || echo "auto" } + get_accent_color_from_config() { + jq -r '.appearance.palette.accentColor' "$SHELL_CONFIG_FILE" 2>/dev/null || echo "" + } + set_accent_color_in_config() { + jq --arg c "$1" '.appearance.palette.accentColor = $c' "$SHELL_CONFIG_FILE" > "$SHELL_CONFIG_FILE.tmp" && mv "$SHELL_CONFIG_FILE.tmp" "$SHELL_CONFIG_FILE" + } detect_scheme_type_from_image() { local img="$1" @@ -338,12 +344,11 @@ main() { shift 2 ;; --color) - color_flag="1" if [[ "$2" =~ ^#?[A-Fa-f0-9]{6}$ ]]; then - color="$2" + set_accent_color_in_config "$2" shift 2 else - color=$(hyprpicker --no-fancy) + set_accent_color_in_config $(hyprpicker --no-fancy) shift fi ;; @@ -365,6 +370,13 @@ main() { esac done + # If accentColor is set in config, use it + config_color="$(get_accent_color_from_config)" + if [[ "$config_color" =~ ^#?[A-Fa-f0-9]{6}$ ]]; then + color_flag="1" + color="$config_color" + fi + # If type_flag is not set, get it from config if [[ -z "$type_flag" ]]; then type_flag="$(get_type_from_config)" From 34b589237460c8caa9aaa5022f7127494bd193be Mon Sep 17 00:00:00 2001 From: Eric <51763643+EricL521@users.noreply.github.com> Date: Sun, 7 Dec 2025 22:50:46 -0500 Subject: [PATCH 2/2] Polish script changes a little --- .../quickshell/ii/scripts/colors/switchwall.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dots/.config/quickshell/ii/scripts/colors/switchwall.sh b/dots/.config/quickshell/ii/scripts/colors/switchwall.sh index 1be85e021..430114d5b 100755 --- a/dots/.config/quickshell/ii/scripts/colors/switchwall.sh +++ b/dots/.config/quickshell/ii/scripts/colors/switchwall.sh @@ -322,8 +322,9 @@ main() { get_accent_color_from_config() { jq -r '.appearance.palette.accentColor' "$SHELL_CONFIG_FILE" 2>/dev/null || echo "" } - set_accent_color_in_config() { - jq --arg c "$1" '.appearance.palette.accentColor = $c' "$SHELL_CONFIG_FILE" > "$SHELL_CONFIG_FILE.tmp" && mv "$SHELL_CONFIG_FILE.tmp" "$SHELL_CONFIG_FILE" + set_accent_color() { + local color="$1" + jq --arg color "$color" '.appearance.palette.accentColor = $color' "$SHELL_CONFIG_FILE" > "$SHELL_CONFIG_FILE.tmp" && mv "$SHELL_CONFIG_FILE.tmp" "$SHELL_CONFIG_FILE" } detect_scheme_type_from_image() { @@ -345,10 +346,13 @@ main() { ;; --color) if [[ "$2" =~ ^#?[A-Fa-f0-9]{6}$ ]]; then - set_accent_color_in_config "$2" + set_accent_color "$2" + shift 2 + elif [[ "$2" == "clear" ]]; then + set_accent_color "" shift 2 else - set_accent_color_in_config $(hyprpicker --no-fancy) + set_accent_color $(hyprpicker --no-fancy) shift fi ;;