Sway : Use on/off again.

This commit is contained in:
Dmitry Voronin 2024-03-29 06:58:54 +03:00
parent e310f16479
commit bd6ee35e49
6 changed files with 12 additions and 34 deletions

3
module/sway/bin/monoff Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power off'

3
module/sway/bin/monon Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power on'

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
IFS=$'\n'
monitors=(
"ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165"
)
disabled="$(swaymsg -t get_outputs | grep power.*false)"
if [[ "${disabled}" = "" ]]; then
action="off"
else
action="on"
fi
for monitor in ${monitors[@]}; do
swaymsg "output \"${monitor}\" power ${action}"
done

3
module/sway/bin/vrroff Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync off'

3
module/sway/bin/vrron Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync on'

View file

@ -1,17 +0,0 @@
#!/usr/bin/env bash
IFS=$'\n'
monitors=(
"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622"
)
enabled="$(swaymsg -t get_outputs | grep adaptive_sync_status.*enabled)"
if [[ "${enabled}" = "" ]]; then
action="on"
else
action="off"
fi
for monitor in ${monitors[@]}; do
swaymsg "output \"${monitor}\" adaptive_sync ${action}"
done