rofi
rofi copied to clipboard
Use Yes or No button option instead typing Yes, Y, No, N for confirmation dialog
I would like to have 2 Option (yes or no) button rather than typing Yes, Y, No, N manually on confirmation dialog (powermenu). i managed to do it here's what im doing.
powermenu.sh :
# Confirmation Dialog
confirmation() {
echo -e "yes\nno" | rofi -dmenu -selected-row 1 -no-fixed-num-lines -theme $HOME/.config/rofi/theme/confirm.rasi
}
options="$shutdown\n$reboot\n$lock\n$suspend\n$logout"
action="$(echo -e "$options" | $rofi_command -p "Uptime: $uptime" -dmenu -selected-row 2)"
case $action in
$shutdown)
choice=$(confirmation &)
case $choice in
yes) systemctl poweroff ;;
no) exit 0 ;;
esac
;;
$reboot)
choice=$(confirmation &)
case $choice in
yes) systemctl reboot ;;
no) exit 0 ;;
esac
esac
i have no idea how rofi theming works, so i hope you can implement this.
That'll be done.