From 204035cb8c932913284ce01530a3c4f36521727f Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 12 Sep 2025 23:03:31 -0700 Subject: [PATCH] Update tv-power-menu.sh --- system-menu/tv-power-menu.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system-menu/tv-power-menu.sh b/system-menu/tv-power-menu.sh index 8c7a102..7e5e61c 100755 --- a/system-menu/tv-power-menu.sh +++ b/system-menu/tv-power-menu.sh @@ -1,6 +1,9 @@ #!/usr/bin/env zsh -choice="$(fuzzel --index -d <<'EOF' +# Remember: for the shell's if, 0 is true and anything else is false! +current="$(wlr-randr --json | jq --raw-output 'if .[] | select(.name == "HDMI-A-1").enabled then "Enabled" else "Disabled" end')" + +choice="$(fuzzel --index -p "Cur: ${current} > " -d <<'EOF' Enable Disable EOF @@ -10,9 +13,9 @@ if (( ${?} != 0 )) || (( "${choice}" == -1 )); then fi case "${choice}" in 0) - wlr-randr --output DP-3 --mode 1920x1080@60 --scale 1 --on + kanshictl switch tv ;; 1) - wlr-randr --output DP-3 --off + kanshictl switch no-tv ;; esac