From f1d995d119de05be3497935d032baa3af35530e0 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Wed, 20 Dec 2023 20:21:40 -0800 Subject: [PATCH] Add tv-power-menu.sh --- system-menu/system-menu.sh | 1 + system-menu/tv-power-menu.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 system-menu/tv-power-menu.sh diff --git a/system-menu/system-menu.sh b/system-menu/system-menu.sh index 89a8549..d02224d 100755 --- a/system-menu/system-menu.sh +++ b/system-menu/system-menu.sh @@ -5,6 +5,7 @@ pgrep swayidle && swayidle_state="Enabled" || swayidle_state="Disabled" # Format: label action condition local entries=('Select system sound output' 'select-sound-output.sh' 'true' "Enable or disable system sleep (Current: ${swayidle_state})" 'system-sleep-menu.sh' 'true' + 'Enable or disable TV' 'tv-power-menu.sh' '[[ "${HOST}" = "alexanders-desktop" ]]' 'Configure USB device access' 'usbguard-menu.py' 'pgrep usbguard-daemon' 'Power settings (restart and shutdown)' 'system-power-menu.sh' 'true') diff --git a/system-menu/tv-power-menu.sh b/system-menu/tv-power-menu.sh new file mode 100755 index 0000000..774487a --- /dev/null +++ b/system-menu/tv-power-menu.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env zsh + +choice="$(fuzzel --index -d <<'EOF' +Enable +Disable +EOF +)" +if (( ${?} != 0 )) || (( "${choice}" == -1 )); then + exit 0 +fi +case "${choice}" in + 0) + hyprctl keyword monitor 'DP-1,1920x1080@60,auto,1' + ;; + 1) + hyprctl keyword monitor 'DP-1,disable' + ;; +esac