blob: e7692e27eb072478ed7e39994bb57603496637bf (
plain) (
tree)
|
|
#!/bin/sh
read -r wallpaper<~/.cache/wallpaper
#### Options ###
power_off=" Shutdown"
reboot=" Reboot"
lock_screen=" Lock Screen"
suspend=" Suspend"
hibernate=" Hibernate"
log_out=" Log Out"
lock="swaylock -f -i "$wallpaper""
# Options passed to fuzzel
options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen"
lines="$(echo "$options" | grep -oF '\n' | wc -l)"
rofi_command="fuzzel -d -w 14 -l $((lines+1))"
chosen="$(echo -e "$options" | $rofi_command )"
case $chosen in
"$lock_screen")
swaylock -f -i "$wallpaper"
;;
"$power_off")
doas poweroff
;;
"$reboot")
doas reboot
;;
"$suspend")
$lock && zzz
;;
"$hibernate")
# $lock && WIP
;;
"$log_out")
riverctl exit
;;
esac
|