#!/bin/bash while sleep 1; do if [ "$(swaymsg -t get_workspaces | jq '.[] | select(.focused == true) | .num')" = '10' ] && ! (ps aux | grep -q [b]eyondallreason.real); then if [ "$l" != 'on' ]; then echo on swaymsg 'output * adaptive_sync on' l='on' fi else if [ "$l" != 'off' ] then echo off swaymsg 'output * adaptive_sync off' l='off' fi fi done