rofi icon indicating copy to clipboard operation
rofi copied to clipboard

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

Open ashtrath opened this issue 4 years ago • 1 comments

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

ashtrath avatar Dec 07 '21 09:12 ashtrath

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

ashtrath avatar Dec 07 '21 09:12 ashtrath

That'll be done.

adi1090x avatar Aug 13 '22 12:08 adi1090x