Short version: How do I automate a libnotify notification occurring every ten minutes? Or what might be better for this than libnotify/pynotify?
I am trying to build a random notification program. The idea will be to randomly show information from a text file every ten minutes; quotes, to-do items, perhaps Twitter updates dumped into a file. Right now I have the following code, which displays a fortune.
However, when I tried to run this every ten minutes with cron, it didn't show, even though I was able to successfully run it as root. (I tried the root crontab and my user crontab...) So I'm thinking it doesn't get access to my X instance, or perhaps the running notifier daemon, or whatever libnotify needs, when it's run by cron.Code:#!/usr/bin/env python import os import pynotify pynotify.init("random information") s = os.popen("fortune -n 100 -s","r").read() n = pynotify.Notification("Fortune",s) n.show()
Anyone know how I could get this simple script to run every ten minutes?
Additionally: Ultimately, when this actually notifies me of useful things rather than just silly quotes, I'll want to be able to attach notifications to arbitrary bash commands or executables. I would want to click on them to launch some behaviour. What could I use to accomplish that? I've found something called mumbles but don't know if it has that feature yet; notify-osd (called by pynotify unless interactions are added to the notification) doesn't. Is there another, featureful notification option?
Bookmarks