Created
January 25, 2022 02:16
-
-
Save ptrcnull/5efc9070acf414506c1e79756604d2b3 to your computer and use it in GitHub Desktop.
Script to toggle SIGSTOP/SIGCONT on all sway GUI processes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pids="$(swaymsg -t get_tree | grep pid | grep -oE '[0-9]+')" | |
first=$(echo "$pids" | head -n 1) | |
if grep -q stopped "/proc/$first/status"; then | |
sig=CONT | |
else | |
sig=STOP | |
fi | |
for pid in $pids; do kill -$sig $pid; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment