aboutsummaryrefslogtreecommitdiffstats
path: root/i3/.config/i3/i3exit
diff options
context:
space:
mode:
Diffstat (limited to 'i3/.config/i3/i3exit')
-rwxr-xr-xi3/.config/i3/i3exit30
1 files changed, 30 insertions, 0 deletions
diff --git a/i3/.config/i3/i3exit b/i3/.config/i3/i3exit
new file mode 100755
index 0000000..4292234
--- /dev/null
+++ b/i3/.config/i3/i3exit
@@ -0,0 +1,30 @@
+#!/bin/sh
+lock() {
+ i3lock -c 2f2f2f
+}
+
+case "$1" in
+ lock)
+ lock
+ ;;
+ 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