Files
random-scripts/system-menu/tv-power-menu.sh
T

22 lines
489 B
Bash
Raw Normal View History

2023-12-20 20:21:40 -08:00
#!/usr/bin/env zsh
2025-09-12 23:03:31 -07:00
# 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'
2023-12-20 20:21:40 -08:00
Enable
Disable
EOF
)"
if (( ${?} != 0 )) || (( "${choice}" == -1 )); then
exit 0
fi
case "${choice}" in
0)
2025-09-12 23:03:31 -07:00
kanshictl switch tv
2023-12-20 20:21:40 -08:00
;;
1)
2025-09-12 23:03:31 -07:00
kanshictl switch no-tv
2023-12-20 20:21:40 -08:00
;;
esac