summaryrefslogtreecommitdiff
path: root/.a/sys/on-wm-logout.sh
blob: 746298125c65de7db36304c8327751295a7c3f11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

# Gracefully close certain programs
grace=()
gui=(brave firefox)

for app in $grace; do
	timeout 5 pkill -TERM $app
done

for app in $gui; do
	wmctrl -c $app
	while [ -n "$(pidof $app)" ]; do
		sleep 1
	done
done

exit 0