Computing

Remote Control - A simple LAN based control Server/Client for controlling applications.

Last updated: Dec. 3, 2007, 12:58 p.m.

I was using my desktop PC yesterday and listening to music on my laptop, I was frustrated by the fact that I couldn't control the music with the media keys on the keyboard I was using without switching the KVM over to my laptop, and then having to switch back. So, I came up with a solution, a client/server UDP based simple remote control system for Amarok.

The application pair is written in Python using the standard sockets module based on the C library. Basically, the server runs in the background listening on a port defined in a config file, when it reveives a string, it compares it to a list of commands loaded when the server was started. If the string corresponds to a known command, the server executes the command using the os.system() call. This means that any command line command can be run by the server, but only commands that are pre-defined can be run so it is quite simple to make sure that the worst a hacker could do is pause your music player.

On the client side a short python script is kept in the user's home directory and can be associated with global short-cuts such as the media keys of a keyboard. When the script is run, it sends the first argument given to it to the server which checks this to see if it's a command and if so runs it.

All the details of how to set up this little application are included in the tar you can download below.

Any comments/queries are welcomed, and since it is in python, it should be very easy to get in there and fiddle with.

AttachmentLast UpdateSize
remote_control.tar.gzOct. 28, 2014, 10:39 p.m.17.3 KB
Section:
Computing
Tags:
 

Comments

Posting comments is not currently possible. If you want to discuss this article you can reach me on twitter or via email.