Link shortening on hotkey

Install keyboard-shortcuts. Also install CSSU, so as to get keyboard-shortcuts work.

Tune /apps/osso/hildon-desktop/key-actions/dbus_shortcuts_use_fn to press Ctrl-Fn-<letter> instead of Ctrl-Shift-<letter> (if you prefer).


import os
import pygtk
import gtk

clipboard = gtk.clipboard_get()
text = clipboard.wait_for_text()

import urllib2
fetcher = urllib2.urlopen('' + text)
text =

os.system("phone-control --notify 'Link is shortened'")


Edit /usr/bin/keyboard-shortcuts:

if key == 'c': # or another letter
    os.system("su user -c ' /home/user/.bin/'")
blog comments powered by Disqus