Being a compulsive computer user, I am in front of it all day. I sometimes lose track of time when I am working on my comp. I need a notification service to alert me of the current time, either by a popup notification or a sound being played or both.
For the popup, I found the Free Desktop notification standard which uses a DBus API.
I was able to create a notification using DFeet, a graphical DBUS explorer. I used the following arguments:
"wakeup", 1234, "", "The time is", "9PM", [], [], 1
It works fine so far, but how can I take it further from here?
- How do I invoke this from the command-line?
- How do I automate this command? Is
cron
still the recommended way of automating time based actions? - How do I play sounds along with the popup? Either via the FreeDesktop API or via a media player?
A complete solution would be appreciated and perhaps useful to others too.
Best Answer
Since I couldn't use
dbus-send
I wrote a python script instead. The pynotify module internally uses thedbus
API. For extra kicks I added a fortune cookie in the message. Works like a charm:I then scheduled this using
cron
. Thecrontab
entry looks like:Update:Added a method to play a sound using pulse audio