forked from giacomos/i3wm-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
i3exit
executable file
·30 lines (28 loc) · 869 Bytes
/
i3exit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
lock() {
i3lock -n -ti /home/jack/Pictures/wallpaper.png
}
case "$1" in
lock)
lock
;;
logout)
i3-msg exit
;;
suspend)
gksu pm-suspend
;;
hibernate)
lock && dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Hibernate
;;
reboot)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart
;;
shutdown)
dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
;;
*)
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
exit 2
esac
exit 0