2

I'm looking to create a global hotkey in Python 3.2 for Ubuntu 12.10. That is, my script will run in the background and whenever I press shift + F4 (for example), no matter what the active window is, the script will do something.

These http://pastebin.com/raw.php?i=J4swvcgD are the resources I've looked at (had to paste them in Pastebin since Stack Overflow only allows me to post two links)

Maybe I am too much of a newb (I am a beginner) or I have been looking in the wrong places or for the wrong things, but, I haven't been able to utilize the resources above.

How can I create a global hotkey with Python 3.2 in Ubuntu 12.10. Thanks!

ps: This is a duplicate of https://askubuntu.com/questions/229129/python-global-hotkey

Morteza Asadi
  • 1,819
  • 2
  • 22
  • 39
stackity
  • 35
  • 5

1 Answers1

3

Take a look at https://github.com/engla/keybinder; it's a simple library that proclaims to enable global keyboard shortcuts and includes Python bindings. It's specific to GTK, but if your target is Ubuntu most Ubuntu systems are using Gnome and GTK-based applications by default. YMMV outside of GTK windows, in which case you'll have to use some lower-level X11 calls.

Iguananaut
  • 21,810
  • 5
  • 50
  • 63