From 5c41160260900398b8f9440edf0c735946187e90 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 5 Oct 2025 14:36:19 -0400 Subject: feat(hyprsunset): add Hyprsunset toggle script, SUPER+N keybind, and Waybar nightlight button across all layouts; include in status and vertical power groups --- config/waybar/ModulesCustom | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'config/waybar/ModulesCustom') diff --git a/config/waybar/ModulesCustom b/config/waybar/ModulesCustom index dddc5ccc..1f4afa20 100644 --- a/config/waybar/ModulesCustom +++ b/config/waybar/ModulesCustom @@ -104,6 +104,17 @@ "tooltip-format": "Left Click: Switch Dark-Light Themes\nMiddle Click: Wallpaper Menu\nRight Click: Waybar Styles Menu", }, +// Night light (Hyprsunset) +"custom/nightlight": { + "return-type": "json", + "exec": "$HOME/.config/hypr/scripts/Hyprsunset.sh status", + "interval": 5, + "format": "{}", + "on-click": "$HOME/.config/hypr/scripts/Hyprsunset.sh toggle", + "tooltip": true, + "tooltip-format": "Night light toggle" +}, + "custom/lock": { "format": "󰌾", "on-click": "$HOME/.config/hypr/scripts/LockScreen.sh", -- cgit v1.2.3 From d200f9134d5e6bbc558b8acaea64229ba7b420cb Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 5 Oct 2025 15:08:38 -0400 Subject: feat(hyprsunset): add libnotify messages on toggle; use plain glyph text; ensure nightlight button is visible in [TOP] Default Laptop; set escape=false for custom/nightlight --- config/hypr/scripts/Hyprsunset.sh | 15 +++++++++------ config/waybar/ModulesCustom | 3 ++- config/waybar/configs/[TOP] Default Laptop | 1 + 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'config/waybar/ModulesCustom') diff --git a/config/hypr/scripts/Hyprsunset.sh b/config/hypr/scripts/Hyprsunset.sh index 0de19d44..0372d720 100755 --- a/config/hypr/scripts/Hyprsunset.sh +++ b/config/hypr/scripts/Hyprsunset.sh @@ -21,20 +21,21 @@ ensure_state() { # Render icons using pango markup to allow colorization icon_off() { - # bright sun when not activated - printf "" + # bright sun when not activated (plain glyph; styling via Waybar CSS by class) + printf "" } icon_on() { case "$ICON_MODE" in sunset) - printf "" + # fallback to same glyph; color can be handled by CSS if desired + printf "" ;; blue) - printf "" + printf "" ;; *) - printf "" + printf "" ;; esac } @@ -50,7 +51,7 @@ cmd_toggle() { sleep 0.2 fi - if [[ "$state" == "on" ]]; then +if [[ "$state" == "on" ]]; then # Turning OFF: set identity and exit if command -v hyprsunset >/dev/null 2>&1; then nohup hyprsunset -i >/dev/null 2>&1 & @@ -58,12 +59,14 @@ cmd_toggle() { sleep 0.3 && pkill -x hyprsunset || true fi echo off > "$STATE_FILE" + notify-send -u low "Hyprsunset: Disabled" || true else # Turning ON: start hyprsunset at target temp in background if command -v hyprsunset >/dev/null 2>&1; then nohup hyprsunset -t "$TARGET_TEMP" >/dev/null 2>&1 & fi echo on > "$STATE_FILE" + notify-send -u low "Hyprsunset: Enabled" "${TARGET_TEMP}K" || true fi } diff --git a/config/waybar/ModulesCustom b/config/waybar/ModulesCustom index 1f4afa20..512ff751 100644 --- a/config/waybar/ModulesCustom +++ b/config/waybar/ModulesCustom @@ -112,7 +112,8 @@ "format": "{}", "on-click": "$HOME/.config/hypr/scripts/Hyprsunset.sh toggle", "tooltip": true, - "tooltip-format": "Night light toggle" + "tooltip-format": "Night light toggle", + "escape": false }, "custom/lock": { diff --git a/config/waybar/configs/[TOP] Default Laptop b/config/waybar/configs/[TOP] Default Laptop index b9722b89..0b264c6b 100644 --- a/config/waybar/configs/[TOP] Default Laptop +++ b/config/waybar/configs/[TOP] Default Laptop @@ -54,6 +54,7 @@ "custom/separator#line", "group/audio", "custom/separator#dot-line", + "custom/nightlight", "group/status", ], } \ No newline at end of file -- cgit v1.2.3 From eeb7d323e179e899bb21ae494b0052f0196362f9 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 5 Oct 2025 15:23:05 -0400 Subject: fix(waybar/nightlight): use universal icons (☀/🌇) and explicit {text} format for JSON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/hypr/scripts/Hyprsunset.sh | 13 +++++++------ config/waybar/ModulesCustom | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'config/waybar/ModulesCustom') diff --git a/config/hypr/scripts/Hyprsunset.sh b/config/hypr/scripts/Hyprsunset.sh index 0372d720..1e84bc66 100755 --- a/config/hypr/scripts/Hyprsunset.sh +++ b/config/hypr/scripts/Hyprsunset.sh @@ -21,21 +21,22 @@ ensure_state() { # Render icons using pango markup to allow colorization icon_off() { - # bright sun when not activated (plain glyph; styling via Waybar CSS by class) - printf "" + # universally available sun symbol + printf "☀" } icon_on() { case "$ICON_MODE" in sunset) - # fallback to same glyph; color can be handled by CSS if desired - printf "" + # sunset emoji (falls back to tofu if no emoji font) + printf "🌇" ;; blue) - printf "" + # no color in text; rely on CSS .on to style if desired + printf "☀" ;; *) - printf "" + printf "☀" ;; esac } diff --git a/config/waybar/ModulesCustom b/config/waybar/ModulesCustom index 512ff751..f4e95433 100644 --- a/config/waybar/ModulesCustom +++ b/config/waybar/ModulesCustom @@ -109,7 +109,7 @@ "return-type": "json", "exec": "$HOME/.config/hypr/scripts/Hyprsunset.sh status", "interval": 5, - "format": "{}", + "format": "{text}", "on-click": "$HOME/.config/hypr/scripts/Hyprsunset.sh toggle", "tooltip": true, "tooltip-format": "Night light toggle", -- cgit v1.2.3 From f24d5aed8e4362f42a022a52c16accbcb5b69c66 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Sun, 5 Oct 2025 17:02:52 -0400 Subject: feat(nightlight/ui): enlarge icon via Pango markup (escape=false), reserve space (min-length) --- config/hypr/scripts/Hyprsunset.sh | 4 ++-- config/waybar/ModulesCustom | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'config/waybar/ModulesCustom') diff --git a/config/hypr/scripts/Hyprsunset.sh b/config/hypr/scripts/Hyprsunset.sh index 1e84bc66..c7c4b395 100755 --- a/config/hypr/scripts/Hyprsunset.sh +++ b/config/hypr/scripts/Hyprsunset.sh @@ -81,11 +81,11 @@ cmd_status() { fi if [[ "$onoff" == "on" ]]; then - txt="$(icon_on)" + txt="$(icon_on)" cls="on" tip="Night light on @ ${TARGET_TEMP}K" else - txt="$(icon_off)" + txt="$(icon_off)" cls="off" tip="Night light off" fi diff --git a/config/waybar/ModulesCustom b/config/waybar/ModulesCustom index f4e95433..146ec275 100644 --- a/config/waybar/ModulesCustom +++ b/config/waybar/ModulesCustom @@ -108,8 +108,9 @@ "custom/nightlight": { "return-type": "json", "exec": "$HOME/.config/hypr/scripts/Hyprsunset.sh status", - "interval": 5, + "interval": 3, "format": "{text}", + "min-length": 2, "on-click": "$HOME/.config/hypr/scripts/Hyprsunset.sh toggle", "tooltip": true, "tooltip-format": "Night light toggle", -- cgit v1.2.3