tags:

views:

126

answers:

2

Hi, I have a XFCE 4.6 on kernel 2.6. Is there a quick and easy way to flash a message on the screen for a few seconds?

My Thinkpad T60 has 3 volume buttons (up, down, mute). When I pressed the buttons, I would like to flash the volume on the screen for a second on screen. Can it be done with Python?

+1  A: 

notification-daemon-xfce allows libnotify clients to show brief messages in XFCE. libnotify has Python bindings available.

As an untested example,

import pynotify
import sys
pynotify.init(sys.argv[0])
notification = pynotify.Notification("Title", "body", "dialog-info")
notification.set_urgency(pynotify.URGENCY_NORMAL)
notification.set_timeout(pynotify.EXPIRES_DEFAULT)
notification.show()
ephemient
+1  A: 

The quickest solution is to use notify-send (provided typically in package libnotify-bin) from the command line

notify-send Hello!
Matti