DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

GrabFocus For Xfce4 Verve Applets In Python Using Dbus.

12.03.2008
| 2267 views |
  • submit to reddit
        // This little code allow to grab focus of the Verve applet(command line interface with auto-completion and command history) using python and dbus system. 


#!/usr/bin/env python

import dbus


try:
	bus = dbus.SessionBus()
except:
	print 'errore nella sessione dbus'
try:
	obj = bus.get_object("org.xfce.RunDialog", "/org/xfce/RunDialog")
	verve = dbus.Interface(obj, "org.xfce.Verve")
except:
	print 'errore....'

verve.GrabFocus()