Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to build a remote control application to control media on my Ubuntu. Does anyone know a way in order to accomplish this. The media keys in particular.

Thank you.


I have tried using XTE, but is seems python in truncating the input or there is a limit or something which means that you can't do Ctrl + Key key presses, which wont suit my needs.

I also tried uinput, but alas you need to run it as root, which also will not quite my needs.

Now I am looking at EVDEV which seems promicing, that is if I can get it working.

share|improve this question
I understand that this is a very incomplete hint but try looking at . It's open source and in python and it does in part wht I believe you're looking for. Their code might be of help. – user35186 Nov 17 '12 at 15:05
Thank you I will definately check it out as I used to use AutoHotKey for Battlefield 2. Appreaciate it, seems to be an issue finding things for unix o.O – Rudi Strydom Nov 17 '12 at 16:09


I though I would share this, should someone look for something similar and happen upon this.

The easiest way I found to send the keystrokes through Python is by installing xdotool which is a unix based scripting tool, wich is pretty awesome. It supports all the multimedia keys. Including the context menu a.k.a "Menu".

So what did I need it for?
I built a remote for my ubuntu since my Compro Remote stopped working.

How does it work?
It leverages Apache, Bootstrap, PHP, Redis, Python and finally xdotools (Boy that's a mouthfull). I created a mini website which I access through my WIFI with remote buttons which when clicked sends the command in the background to the PHP Script running on Apache.

This PHP script then saves the command and values in Redis which is polled constantly by Python. Once Python picks the command up. It checks it in the dictionary of commands and sends the appropiate command line to xdotool. Xdotool then runs the Media Keys or starts Rhythmbox or XBMC or pauses and plays. Whatever. So far it's working like a charm.

Head on over to Github

I am putting a github repositry together for this. I hope this helps someone, somewhere

Installation instructions etc. to follow in said Github page.

Web The Black Mote Github Page

share|improve this answer
up vote 0 down vote accepted

For the latest version please check out Pymote. This remote layout has changed, and I still need to update the image on the page.

This version has been simplified quite allot and requires only Python and Xdotools to be installed.

Pymote on GitHub

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.