From ca9f7dd9e4627122d6e773a227931312ffc31465 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 25 Feb 2023 12:38:39 +0200 Subject: [.a/sys/owl] Graceful closure of gui apps now properly waits for the application to end --- .a/sys/on-wm-logout.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to '.a/sys') diff --git a/.a/sys/on-wm-logout.sh b/.a/sys/on-wm-logout.sh index 963578d..7462981 100755 --- a/.a/sys/on-wm-logout.sh +++ b/.a/sys/on-wm-logout.sh @@ -1,10 +1,18 @@ #!/bin/bash # Gracefully close certain programs -grace=(brave) +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 -- cgit v1.2.3