Swayscript : Add dasha monitor to vrr & mon.

This commit is contained in:
Dmitry Voronin 2024-06-27 20:26:30 +03:00
parent f068155c19
commit 0812f2193b
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 14 additions and 23 deletions

View file

@ -1,16 +1,11 @@
{ ... }: {
text = ''
export _swaymonlist=(
"ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165"
"AU Optronics 0x418D Unknown"
)
# Enable monitors.
function monon() {
on() {
for mon in ''${_swaymonlist[@]}; do
swaymsg "output \"''${mon}\" power on"
done
swaymsg "output \"ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165\" power on"
swaymsg "output \"AU Optronics 0x418D Unknown\" power on"
swaymsg "output \"AOC 24G2W1G4 ATNL61A129625\" power on"
_monstate on
}
_sway_iterate_sockets on
@ -19,9 +14,9 @@
# Disable monitors.
function monoff() {
off() {
for mon in ''${_swaymonlist[@]}; do
swaymsg "output \"''${mon}\" power off"
done
swaymsg "output \"ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165\" power off"
swaymsg "output \"AU Optronics 0x418D Unknown\" power off"
swaymsg "output \"AOC 24G2W1G4 ATNL61A129625\" power off"
_monstate off
}
_sway_iterate_sockets off

View file

@ -1,17 +1,13 @@
# TODO: Add different modes for different screens.
{ ... }: {
text = ''
export _swayvrrlist=(
"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622"
)
# Enable VRR.
function vrron() {
on() {
for vrr in ''${_swayvrrlist[@]}; do
swaymsg "output \"''${vrr}\" adaptive_sync on"
swaymsg "output \"''${vrr}\" mode 3440x1440@164.999Hz"
done
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"
_vrrstate on
}
_sway_iterate_sockets on
@ -20,10 +16,10 @@
# Disable VRR.
function vrroff() {
off() {
for vrr in ''${_swayvrrlist[@]}; do
swaymsg "output \"''${vrr}\" adaptive_sync off"
swaymsg "output \"''${vrr}\" mode 3440x1440@59.973Hz"
done
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"
_vrrstate off
}
_sway_iterate_sockets off