#!/bin/sh # Get current set wallpaper for the lockscreen option read -r wallpaper<~/.cache/wallpaper # Option text to display power_off=" Shutdown" reboot="󰜉 Reboot" lock_screen=" Lock Screen" suspend=" Suspend" hibernate="󰒲 Hibernate" log_out="󰍃 Log Out" #lock="swaylock -f -i "$wallpaper"" lock="swaylock -f -i $wallpaper --effect-blur 10x5 --clock --datestr '%a %d %b %Y' --indicator" # 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" --effect-blur 10x5 --clock --datestr "%a %d %b %Y" --indicator ;; "$power_off") doas poweroff ;; "$reboot") doas reboot ;; "$suspend") $lock && doas zzz ;; "$hibernate") # $lock && WIP ;; "$log_out") mmsg -d quit ;; esac