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

22 lines
489 B
Bash
Executable File

#!/usr/bin/env zsh
# 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
)"
if (( ${?} != 0 )) || (( "${choice}" == -1 )); then
exit 0
fi
case "${choice}" in
0)
kanshictl switch tv
;;
1)
kanshictl switch no-tv
;;
esac