adi1090x / rofi

A huge collection of Rofi based custom Applets, Launchers & Powermenus.
GNU General Public License v3.0
6.36k stars 298 forks source link

Use Yes or No button option instead typing Yes, Y, No, N for confirmation dialog #81

Closed Dyzean closed 1 year ago

Dyzean commented 2 years ago

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
Dyzean commented 2 years ago

i have no idea how rofi theming works, so i hope you can implement this.

adi1090x commented 1 year ago

That'll be done.