diff options
Diffstat (limited to '.i3/.i3exit')
| -rwxr-xr-x | .i3/.i3exit | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/.i3/.i3exit b/.i3/.i3exit new file mode 100755 index 0000000..cec55dd --- /dev/null +++ b/.i3/.i3exit @@ -0,0 +1,31 @@ +#!/bin/sh +lock() { + +# Add a small delay to prevent suspend races + +i3lock && sleep 1 + +} + +case "$1" in + lock) + lock + ;; + logout) + i3-msg exit + ;; + suspend) + lock && systemctl suspend + ;; + reboot) + systemctl reboot + ;; + shutdown) + systemctl poweroff + ;; + *) + echo "Usage: $0 {lock | logout | suspend | reboot | shutdown}" + exit 2 +esac + +exit 0 |
