about summary refs log tree commit diff
path: root/i3_exit
diff options
context:
space:
mode:
Diffstat (limited to 'i3_exit')
-rwxr-xr-xi3_exit30
1 files changed, 30 insertions, 0 deletions
diff --git a/i3_exit b/i3_exit
new file mode 100755
index 000000000000..f411d4e57c95
--- /dev/null
+++ b/i3_exit
@@ -0,0 +1,30 @@
+#!/bin/sh
+lock() {
+    i3lock
+}
+
+case "$1" in
+    lock)
+        xsecurelock
+        ;;
+    logout)
+        i3-msg exit
+        ;;
+    suspend)
+        lock && systemctl suspend
+        ;;
+    hibernate)
+        lock && systemctl hibernate
+        ;;
+    reboot)
+        systemctl reboot
+        ;;
+    shutdown)
+        systemctl poweroff
+        ;;
+    *)
+        echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
+        exit 2
+esac
+
+exit 0