blob: 197013ae53ee48cacfbce1ed3b47fa38e8afced9 (
plain) (
blame)
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/bash
set -eu
# shellcheck disable=2034
description="suspend manager"
FUZL_PROMPT=susm
. libfuzl.sh
main() {
local action
action=$( (
printf '%s\t%s\n' 'suspend'
printf '%s\t%s\n' 'reboot'
printf '%s\t%s\n' 'poweroff'
printf '%s\t%s\n' 'lock'
) | fuzl_menu $FUZL_MENU_FILTER --with='{1} {2}' --accept-nth=2)
case "$action" in
suspend | poweroff | reboot)
exec loginctl $action
;;
lock)
exec waylock
;;
esac
}
main
|