nix/module/sway/bin/vrrtoggle

18 lines
335 B
Bash
Executable file

#!/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