Thursday, April 25, 2013

Scheduled Message Box Popup in Fedora 18 Linux (Gnome Desktop)

I've been using Windows Task Scheduler to popup messages at scheduled time regularly to do certain works. I needed the same thing in Linux desktop and able found the same thing.

I used Gnome-Scheduler as the task scheduler program since it has a nice and simple GUI. Command line users can use crontab. KDE desktop users can try KCRon or KTimer (Link 1 or Link 2).


Since I'm using Gnome desktop, I used Zenity for message popup option (you can also use xmessage). KDE desktop users can try KDialogue.

So the following packages are required -
- Task Scheduler (either crontab or Gnome-Scheduler)
- Message Dialog Box (either Zenity or xmessage)

I used Zenity and Gnome-Scheduler. Fortunately zenity is already installed with Gnome desktop environment. To install Gnome-Scheduler use the following command -

Fedora: yum -y install gnome-schedule
Ubuntu: apt-get install gnome-schedule

Now start gnome scheduler.


Click New. It will open the following - 


Since I want the message box to be open regularly at a specific time I will use the recurrent option. This recurring option uses crontab as backend program.
You can also use task to run only once, which uses at in the background. There is also custom template but you might never need it.

By selecting recurrent will open a new window. Here you can specify a name of the job as well as the command to run. To popup a message at 12:30PM on every Wednesday I use the following -
Description : Test
Command : zenity --info --title "Test Message" --text "This is a test message"
Select X application in place of Default beahaviour
Select Advanced in Time & Date and insert my required time format as follow -
Minute : 30
Hour : 12
Weekday : 4
These are standard crontab systex.
For more information about cron systex see the manual page of crontab by typing
# man 5 crontab


After successfully adding the parameters you will see a new entry in the Gnome-Scheduler main window. To check if the insertions are ok select the entry and click Run Selected Task as below.


A confirmation message my appear as below -


Click Execute and the your message box will appear as below.


Close the message box by clicking OK and then press enter by to close the terminal window.

Note that, the terminal window will not appear when your message pops up at scheduled time.

There are more you can do with Zenity other than merely popup informational message box. To know more about Zenity go to the Zenity Manual page.

Reference
How To Schedule Tasks With Gnome-Scheduler
Send Messages over Network – Gnome Popup Box Message
Zenity Manual

No comments:

Post a Comment