diff options
Diffstat (limited to 'sway/.local')
-rwxr-xr-x | sway/.local/bin/import-gsettings (renamed from sway/.local/lib/sway/import-gsettings) | 0 | ||||
-rwxr-xr-x | sway/.local/bin/sway-vrr | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sway/.local/lib/sway/import-gsettings b/sway/.local/bin/import-gsettings index 93cd75b..93cd75b 100755 --- a/sway/.local/lib/sway/import-gsettings +++ b/sway/.local/bin/import-gsettings diff --git a/sway/.local/bin/sway-vrr b/sway/.local/bin/sway-vrr new file mode 100755 index 0000000..e989ce9 --- /dev/null +++ b/sway/.local/bin/sway-vrr @@ -0,0 +1,24 @@ +#!/bin/sh + +swaymsg -t subscribe -m '[ "window" ]' | + jq -c --unbuffered 'select(.change == "focus" or .change == "fullscreen_mode") | .container | + if .fullscreen_mode == 1 then + { "id": .id, "sync": "enabled", "rt": 1 } + else + { "id": .id, "sync": "disabled", "rt": 0 } + end' | + while read -r vals; do + swaymsg -t get_tree | jq -r --argjson vals "$vals" --arg regex "$1" '.nodes[] | + select((.. | .nodes?[]?.nodes?[]?.id == $vals.id) and (.name | test($regex))) | + if .adaptive_sync_status != $vals.sync then + [ .name, "adaptive_sync", $vals.sync ] | @sh + else + empty + end, + if .max_render_time != $vals.rt then + [ .name, "max_render_time", ($vals.rt | if . == 0 then "off" else . end) ] | @sh + else + empty + end' + done | + xargs -l1 swaymsg output |