mirror of
https://github.com/hydroxycarbamide/dotfiles.git
synced 2025-05-04 11:59:07 -04:00
make vrr_fullscreen.sh executable
This commit is contained in:
parent
21eb3180ed
commit
a29790fbdd
1 changed files with 4 additions and 4 deletions
8
dot_config/sway/scripts/vrr_fullscreen.sh → dot_config/sway/scripts/executable_vrr_fullscreen.sh
Executable file → Normal file
8
dot_config/sway/scripts/vrr_fullscreen.sh → dot_config/sway/scripts/executable_vrr_fullscreen.sh
Executable file → Normal file
|
@ -7,17 +7,17 @@ output_vrr_whitelist=(
|
|||
|
||||
# Toggle VRR for fullscreened apps in prespecified displays to avoid stutters while in desktop
|
||||
swaymsg -t subscribe -m '[ "window" ]' | while read window_json; do
|
||||
window_event=$(echo ${window_json} | jq -r '.change')
|
||||
window_event=$(echo "${window_json}" | jq -r '.change')
|
||||
|
||||
# Process only focus change and fullscreen toggle
|
||||
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')
|
||||
output_name=$(echo "${output_json}" | jq -r '.name')
|
||||
|
||||
# Use only VRR in whitelisted outputs
|
||||
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')
|
||||
output_vrr_status=$(echo "${output_json}" | jq -r '.adaptive_sync_status')
|
||||
window_fullscreen_status=$(echo "${window_json}" | jq -r '.container.fullscreen_mode')
|
||||
|
||||
# Only update output if nesseccary to avoid flickering
|
||||
[[ $output_vrr_status = "disabled" && $window_fullscreen_status = "1" ]] && swaymsg output "${output_name}" adaptive_sync 1
|
Loading…
Add table
Add a link
Reference in a new issue