Zenity - 按Enter键进入表单

时间:2017-09-20 12:37:18

标签: zenity

我试图像这样制作一个简单的提醒计时器:

#/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

它工作正常,但输入键没有按 - 确定 - 表格。它确实在--entry。

如何让它在--forms?

上运行

0 个答案:

没有答案