i want create simple application for notification in ubuntu…
For example: in 18:00, 21:00, 24:00 i want to receive message from ubuntu
simple method for message is:
def alarm
%x{notify-send -i rhythmbox Test "Hello world" }
end
alarm
and when i sart this file ( like: ruby somefilename.rb )
i got notification message.
Question: how to cause this file run in 18:00, 21:00, 24:00
PS I know that there are many similar programs (for the experience like to know how to do that)
U.D. Using crontab:
* * * * * %x{notify-send -i rhythmbox Test "Hello world" }
Every minutes should start this script – but nothing happend
in some examples i saw that instead of script we put path to them: something like this:
* * * * * ruby /home/Home/myDisk/somefile.rb
how open with ruby this file or launch notify-send script in terminal without ruby ?
Good tools are
cronandanacron.To do it in Ruby, one way is to use the Ruby
sleepmethod:To use your “wake up” times in a loop:
Also see Ruby
Threadto do alarms in parallel: