On Fri, May 07, 2010 at 08:54:35PM +0200, Petter Reinholdtsen wrote:
> > I'm starting to wonder if the approach from Sune might be better for
> > now, issuing notify events on the session dbus. :/
> 
> An platform independent approach might be to use the python and
> pynotify to submit the notifications.  This code fragment will show a
> popup on any desktop, as far as I know:

an even shorter script, dropped into /etc/ltspfs/mounter.d and made executable:

#!/usr/bin/python
# requires python-notify
import pynotify
import sys
if not pynotify.init("test"):
  sys.exit(1)
n = pynotify.Notification("ltspfs","%s" % sys.argv[1]+' '+sys.argv[2])
n.show()

sys.argv[1] will either be "add" or "remove" and sys.argv[2] is the path of the
mountpoint (i.e. /media/USERNAME/DEVICE).

this is definitely worth including the the examples section... though it might
just be seen as noise for a gnome install, so i'm not sure it should be
installed by default.

> I'm not sure if it is possible to get the nice button Sune inserted
> nor to automatically remove the "device present" message when the
> device is removed, but it would allow us to add a popup without
> pulling in the KDE libraries as dependencies.

the notificaton messages in LXDE seemed to eventually disappear on their own,
and it issues another message on device removal.

live well,
  vagrant



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to