3

I'm trying to make a simple reminder timer like this:

#/bin/bash

STRING=$(zenity --forms --title="$OPTION" --add-entry="Enter timer duration: (3600s = 60m = 1h)" --add-entry="Remind me about: ")
TIMER=$(echo $STRING | cut -d"|" -f1)
REASON=$(echo $STRING | cut -d"|" -f2)

if [ $TIMER ]
then
  if [ $REASON ]
  then
    zenity --info --title="Confirmation" --text="I will remind you about \"$REASON\"\n in \"$TIMER\""
    sleep $TIMER
    zenity --info --title="Timer done" --text="It has now been $TIMER\n\nRemember \"$REASON\"\nTimer done at: `date | awk '{ print $4 }'`"
  else
    zenity --info --timeout 3 --title="$OPTION" --text="You will be reminded in $TIMER"
    sleep $TIMER
    zenity --info --title="Timer done" --text="It has now been $TIMER\nTimer done at: `date | awk '{ print $4 }'`"
  fi
fi

It works fine but the enter key doesn't press OK on --forms. It does on --entry.

How can I make it work on --forms?

  • 1
    I searched around stackoverflow and found some unrelated quesions about Zenity where people tipped about Yad, a fork that fixes some issues with Zenity. It also solved this issue. I do consider it a workaround and would still like a solution using Zenity if possible. – Patrik Dellhem Sep 21 '17 at 08:01
  • you found something on this ?? – Inder Jan 19 '19 at 17:55

0 Answers0