Summary Files Commits Branches @commit @diff @stats
path: root / scripts / bin / on-logout
diff options
context:
space:
mode:
1 files changed, 18 insertions, 0 deletions
-rwxr-xr-xscripts/bin/on-logout18
diff --git a/scripts/bin/on-logout b/scripts/bin/on-logout
new file mode 100755
index 0000000..8be0a81
--- /dev/null
+++ b/scripts/bin/on-logout
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Gracefully close certain programs
+grace=()
+gui=(brave firefox-bin)
+
+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