scripts/sway/fullscreen-inhibiter.sh

11 lines
401 B
Bash
Executable File

#!/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)')
if [ $IN_FULLSCREEN = "true" ]; then
dunstctl set-paused true
else
dunstctl set-paused false
fi