2024-05-08 18:26:33 +03:00
|
|
|
{ ... }: {
|
|
|
|
text = ''
|
2024-07-27 03:35:59 +03:00
|
|
|
# Enable Gaming.
|
|
|
|
function gamingon() {
|
2024-05-08 18:26:33 +03:00
|
|
|
on() {
|
2024-06-27 20:26:30 +03:00
|
|
|
swaymsg "output \"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622\" adaptive_sync on"
|
|
|
|
swaymsg "output \"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622\" mode 3440x1440@164.999Hz"
|
|
|
|
swaymsg "output \"AOC 24G2W1G4 ATNL61A129625\" adaptive_sync on"
|
|
|
|
swaymsg "output \"AOC 24G2W1G4 ATNL61A129625\" mode 1920x1080@144.000Hz"
|
2024-07-27 03:35:59 +03:00
|
|
|
_gamingstate on
|
2024-05-08 18:26:33 +03:00
|
|
|
}
|
|
|
|
_sway_iterate_sockets on
|
|
|
|
}
|
|
|
|
|
2024-07-27 03:35:59 +03:00
|
|
|
# Disable Gaming.
|
|
|
|
function gamingoff() {
|
2024-05-08 18:26:33 +03:00
|
|
|
off() {
|
2024-06-27 20:26:30 +03:00
|
|
|
swaymsg "output \"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622\" adaptive_sync off"
|
|
|
|
swaymsg "output \"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622\" mode 3440x1440@59.973Hz"
|
|
|
|
swaymsg "output \"AOC 24G2W1G4 ATNL61A129625\" adaptive_sync off"
|
|
|
|
swaymsg "output \"AOC 24G2W1G4 ATNL61A129625\" mode 1920x1080@60.000Hz"
|
2024-07-27 03:35:59 +03:00
|
|
|
_gamingstate off
|
2024-05-08 18:26:33 +03:00
|
|
|
}
|
|
|
|
_sway_iterate_sockets off
|
|
|
|
}
|
|
|
|
|
2024-07-27 03:35:59 +03:00
|
|
|
# Toggle gaming.
|
|
|
|
function gamingtoggle() {
|
|
|
|
if [[ "$(_gamingstate)" = "on" ]]; then
|
|
|
|
gamingoff
|
2024-05-08 19:22:04 +03:00
|
|
|
else
|
2024-07-27 03:35:59 +03:00
|
|
|
gamingon
|
2024-05-08 18:26:33 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-07-27 03:35:59 +03:00
|
|
|
function _gamingstate() {
|
2024-05-08 18:26:33 +03:00
|
|
|
if [[ "''${1}" = "" ]]; then
|
2024-07-27 03:35:59 +03:00
|
|
|
cat /tmp/.gamingstate 2> /dev/null || echo off
|
2024-05-08 18:26:33 +03:00
|
|
|
else
|
2024-07-27 03:35:59 +03:00
|
|
|
echo "''${*}" > /tmp/.gamingstate
|
2024-05-08 18:26:33 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
}
|