aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/.local/bin/i3exit
blob: 9e3f3a1e469a5b8f418ac37b032993686d2eb3d4 (plain)
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() {
  $HOME/.local/bin/betterlock -$1 blur
}

case "$1" in
  lock)
    lock l
    ;;
  logout)
    i3-msg exit
    ;;
  suspend)
    lock s
    ;;
  hibernate)
    lock && systemctl hibernate
    ;;
  reboot)
    systemctl reboot
    ;;
  shutdown)
    systemctl poweroff
    ;;
  *)
    echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}"
    exit 2
esac

exit 0