Fixed fullscreen inhibitor

This commit is contained in:
lanxu 2022-04-05 21:08:20 +03:00
parent 0bb20e93b0
commit 407c93c90d

View File

@ -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