diff options
| author | 2026-10-13 17:03:34 -0400 | |
|---|---|---|
| committer | 2026-10-13 17:03:34 -0400 | |
| commit | 89387549e2670159a211de39a4ddf668addd9e9e (patch) | |
| tree | f372f7847a048b0325cc478c272bc7d9da9936f7 /files/sway | |
| parent | 33567739337783e67167a43557c434accb6fe3a0 (diff) | |
| download | dotfiles-master.tar.gz dotfiles-master.tar.bz2 dotfiles-master.zip | |
Diffstat (limited to 'files/sway')
| -rw-r--r-- | files/sway/config | 1 | ||||
| -rw-r--r-- | files/sway/monitors | 4 | ||||
| -rwxr-xr-x | files/sway/vrr_fullscreen.sh | 29 | ||||
| -rw-r--r-- | files/sway/window_rules | 3 |
4 files changed, 32 insertions, 5 deletions
diff --git a/files/sway/config b/files/sway/config index 102f69b..c2949fd 100644 --- a/files/sway/config +++ b/files/sway/config @@ -110,7 +110,6 @@ client.urgent $urgent $urgent $fg $urgent $urgent client.placeholder $bg $bg $fg $bg $bg client.background $bg -#seat * hide_cursor when-typing enable exec_always swaymsg 'seat * hide_cursor 4000' exec dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK MAIN_MONITOR diff --git a/files/sway/monitors b/files/sway/monitors index 94f0ddf..602129b 100644 --- a/files/sway/monitors +++ b/files/sway/monitors @@ -1,3 +1,3 @@ -set $monitor1 DP-1 -set $monitor2 HDMI-A-1 +set $monitor1 HDMI-A-1 +set $monitor2 DP-1 set $monitor3 HDMI-A-2 diff --git a/files/sway/vrr_fullscreen.sh b/files/sway/vrr_fullscreen.sh new file mode 100755 index 0000000..0db4e10 --- /dev/null +++ b/files/sway/vrr_fullscreen.sh @@ -0,0 +1,29 @@ +#! /usr/bin/env bash + +# https://github.com/swaywm/sway/issues/5076#issuecomment-1753499364 + +output_vrr_whitelist=("$(awk -F ' ' 'NR==1{print $3}' $HOME/.config/sway/monitors)") + +swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do + app_id=$(echo ${window_json} | jq -r '.container.app_id') + if [[ $app_id == "com.moonlight_stream.Moonlight" || $app_id == "Waydroid" ]]; then + continue + fi + window_event=$(echo ${window_json} | jq -r '.change') + if [[ $window_event = "focus" || $window_event = "fullscreen_mode" ]]; then + output_json=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused == true)') + output_name=$(echo ${output_json} | jq -r '.name') + if [[ ${output_vrr_whitelist[*]} =~ ${output_name} ]]; then + output_vrr_status=$(echo ${output_json} | jq -r '.adaptive_sync_status') + window_fullscreen_status=$(echo ${window_json} | jq -r '.container.fullscreen_mode') + if [[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]]; then + swaymsg output "${output_name}" adaptive_sync 1 + swaymsg 'seat * hide_cursor 0' + fi + if [[ $output_vrr_status = "enabled" && $window_fullscreen_status = "0" ]]; then + swaymsg output "${output_name}" adaptive_sync 0 + swaymsg 'seat * hide_cursor 4000' + fi + fi + fi +done diff --git a/files/sway/window_rules b/files/sway/window_rules index 22d5138..5a1e40c 100644 --- a/files/sway/window_rules +++ b/files/sway/window_rules @@ -10,9 +10,8 @@ for_window [app_id=mpv] floating enable for_window [app_id=Waydroid] floating enable for_window [title=Parsec] inhibit_idle fullscreen for_window [class=streaming_client] inhibit_idle fullscreen -#for_window [class=steam_app_.*] inhibit_idle fullscreen, allow_tearing yes for_window [class=steam_app_.*] inhibit_idle fullscreen -for_window [app_id=monsterhunterworld.exe] inhibit_idle fullscreen +for_window [app_id=monsterhunterworld.exe] inhibit_idle fullscreen, allow_tearing yes for_window [app_id=gamescope] inhibit_idle fullscreen, allow_tearing yes, floating enable for_window [class=.gamescope-wrapped] inhibit_idle fullscreen, allow_tearing yes for_window [app_id=osu!] inhibit_idle fullscreen, allow_tearing yes |