29 lines
512 B
Bash
Executable File
29 lines
512 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euf -o pipefail
|
|
|
|
rofi_command="rofi -theme customenu"
|
|
|
|
### Options ###
|
|
shutdown="shutdown"
|
|
reboot="reboot"
|
|
lock="lock"
|
|
log_out="log out"
|
|
# Variable passed to rofi
|
|
options="$shutdown\n$reboot\n$lock\n$log_out"
|
|
|
|
chosen="$(echo -e "$options" | $rofi_command -dmenu -selected-row 2)"
|
|
case $chosen in
|
|
$shutdown)
|
|
systemctl poweroff
|
|
;;
|
|
$reboot)
|
|
systemctl reboot
|
|
;;
|
|
$lock)
|
|
exeflock4
|
|
;;
|
|
$log_out)
|
|
bspc quit 1
|
|
;;
|
|
esac
|