aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authorJaKooLit <jimmilovejay@gmail.com>2023-11-04 08:27:54 +0900
committerJaKooLit <jimmilovejay@gmail.com>2023-11-04 08:27:54 +0900
commit68fe5e3461d9e5d17e352708b1c10deb44a0f922 (patch)
treecd1487c318573d1cb354ed2a54c7ca3ec7aa00e3 /config/hypr/scripts
parentf33963b0b9b62cb90ed8c66c28cd358c133c98d3 (diff)
improved wlogout script. added timeout of 30 secs
Diffstat (limited to 'config/hypr/scripts')
-rwxr-xr-xconfig/hypr/scripts/Wlogout.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh
index 88e91826..43f74108 100755
--- a/config/hypr/scripts/Wlogout.sh
+++ b/config/hypr/scripts/Wlogout.sh
@@ -1,4 +1,15 @@
#!/bin/bash
-wlogout --protocol layer-shell -b 5 -T 600 -B 600 && disown
- \ No newline at end of file
+# Start wlogout in the background
+wlogout --protocol layer-shell -b 5 -T 600 -B 600 &
+
+# Capture the PID of the wlogout process
+wlogout_pid=$!
+
+# Wait for up to 30 seconds for wlogout to exit gracefully
+timeout 30s tail --pid $wlogout_pid -f /dev/null
+
+# If wlogout is still running after the timeout, forcefully kill it
+if ps -p $wlogout_pid > /dev/null; then
+ kill -KILL $wlogout_pid
+fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage