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