34 lines
505 B
Bash
34 lines
505 B
Bash
|
OPTIONS="Reboot\nPoweroff\nSuspend\nHibernate\nLogout\nLock\n"
|
||
|
|
||
|
lock() {
|
||
|
WINDOW=:0 xscreensaver-command -lock
|
||
|
}
|
||
|
|
||
|
if [ "$@" ]
|
||
|
then
|
||
|
case $@ in
|
||
|
Exit)
|
||
|
i3-msg exit
|
||
|
;;
|
||
|
Reboot)
|
||
|
systemctl reboot
|
||
|
;;
|
||
|
Poweroff)
|
||
|
systemctl poweroff
|
||
|
;;
|
||
|
Suspend)
|
||
|
lock; systemctl suspend
|
||
|
;;
|
||
|
Hibernate)
|
||
|
lock; systemctl hibernate
|
||
|
;;
|
||
|
Lock)
|
||
|
lock;
|
||
|
;;
|
||
|
*)
|
||
|
;;
|
||
|
esac
|
||
|
else
|
||
|
echo -en $OPTIONS
|
||
|
fi
|