feat: Waybar improvements and refactoring (multiple changes)

This commit is contained in:
2025-09-22 22:37:55 +02:00
parent 8c9fcbbbf4
commit 9e5c90fcb6
8 changed files with 83 additions and 56 deletions

View File

@@ -45,7 +45,7 @@ esac
# Emit compact JSON for Statusbar
jq -nc \
--arg text "<span color=\"#4F84CC\">$icon</span> <span color=\"#CAD3E8\">$text</span>" \
--arg text "<span color=\"#FFFFFF\">$icon</span> <span color=\"#FFFFFF\">$text</span>" \
--arg class "$class" \
--arg tooltip "$tooltip" \
'{text: $text, class: $class, tooltip: $tooltip}'

View File

@@ -53,6 +53,21 @@ print_json() {
fi
}
increase_temp() {
local t="$(cur_temp)"
[ -z "$t" ] && t=3800
t=$((t+200))
set_temp "$t"
}
decrease_temp() {
local t="$(cur_temp)"
[ -z "$t" ] && t=3800
t=$((t-200))
if [ "$t" -lt 1000 ]; then t=1000; fi
set_temp "$t"
}
case "${1:---print}" in
--print) print_json ;;
--auto-on) echo -n "1" > "$AUTO_FILE" ; print_json ;;
@@ -84,6 +99,14 @@ case "${1:---print}" in
set_temp "$t"
print_json
;;
*) echo "Usage: $0 [--print|--toggle-auto|--auto-on|--auto-off|--toggle|--set TEMP]" >&2; exit 1 ;;
--increase)
increase_temp
print_json
;;
--decrease)
decrease_temp
print_json
;;
*) echo "Usage: $0 [--print|--toggle-auto|--auto-on|--auto-off|--toggle|--set TEMP|--increase|--decrease]" >&2; exit 1 ;;
esac

View File

@@ -32,7 +32,7 @@ else
fi
jq -nc \
--arg text "<span color=\"#4F84CC\">$icon</span> <span color=\"#CAD3E8\">$text</span>" \
--arg text "<span color=\"#4F84CC\">$icon</span> <span color=\"#CAD3E8\">$text</span>" \
--arg class "$class" \
--arg tooltip "$tooltip" \
'{text: $text, class: $class, tooltip: $tooltip}'