Python port of Autoremote plugin by João Dias.