From 407c93c90dfece758eb994127299b0d97eba42df Mon Sep 17 00:00:00 2001 From: lanxu Date: Tue, 5 Apr 2022 21:08:20 +0300 Subject: [PATCH] Fixed fullscreen inhibitor --- sway/fullscreen-inhibitor.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sway/fullscreen-inhibitor.sh b/sway/fullscreen-inhibitor.sh index 6a8a637..610c90d 100755 --- a/sway/fullscreen-inhibitor.sh +++ b/sway/fullscreen-inhibitor.sh @@ -1,9 +1,10 @@ #!/bin/sh # Get all open windows from sway -IN_FULLSCREEN=$(swaymsg -t get_tree | jq '[[recurse(.nodes[]) | del(.nodes)] | .[] | select((.window_properties.class) or (.app_id)) | {app_id: .app_id, class: .window_properties.class, fullscreen_mode: .fullscreen_mode}]' | jq 'any(.fullscreen_mode == 1)') +IN_FULLSCREEN_NODES=$(swaymsg -t get_tree | jq '[paths(objects | select(.nodes)) as $p | getpath($p) | select((.window_properties.class) or (.app_id)) | {name: .name, app_id: .app_id, class: .window_properties.class, fullscreen_mode: .fullscreen_mode, focused: .focused}]' | jq 'any(.fullscreen_mode == 1)') +IN_FULLSCREEN_FLOATING_NODES=$(swaymsg -t get_tree | jq '[paths(objects | select(.floating_nodes)) as $p | getpath($p) | select((.window_properties.class) or (.app_id)) | {name: .name, app_id: .app_id, class: .window_properties.class, fullscreen_mode: .fullscreen_mode, focused: .focused}]' | jq 'any(.fullscreen_mode == 1)') -if [ $IN_FULLSCREEN = "true" ]; then +if [ $IN_FULLSCREEN_NODES = "true" ] || [ $IN_FULLSCREEN_FLOATING_NODES = "true" ]; then dunstctl set-paused true else dunstctl set-paused false