Tags: Nokia N900 (Atom feed)

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).

/home/user/.bin/clck.py:

#!/usr/bin/python
import os
import pygtk
pygtk.require('2.0')
import gtk

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

import urllib2
fetcher = urllib2.urlopen('http://clck.ru/--?url=' + text)
text = fetcher.read()

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

clipboard.set_text(text)
clipboard.store()

Edit /usr/bin/keyboard-shortcuts:

if key == 'c': # or another letter
    os.system("su user -c 'run-standalone.sh /home/user/.bin/clck.py'")

Out-call-vibro variant, using dbus-scripts

After installing enhanced-busybox, out-call-vibro refused to work. I had rewritten it using dbus-scripts.

/etc/dbus-scripts.d/out-call-vibro.dbus:

/home/user/.bin/out-call-vibro.sh * * org.freedesktop.Telepathy.Channel.Interface.Group MembersChanged *

/home/user/.bin/out-call-vibro.sh:

#!/bin/sh
if [[ "$5" == "Call answered" ]]; then
    if [ `cat /sys/devices/platform/gpio-switch/proximity/state` = "open" ]; then
        echo 150 > /sys/class/leds/twl4030:vibrator/brightness
        gsleep 0.5
        echo 0 > /sys/class/leds/twl4030:vibrator/brightness
    fi
fi

Unlocked volume buttons while screen is locked

To unlock volume buttons while the screen is locked, edit /etc/mce/mce.ini, so as parameter DisableKPImmediately in section [TKLock] equals 2.

# Policy for keypad interrupts
#
# 2 - leave keypad interrupts on even after blanking
#     (used to support pass-through of +/-)
# 1 - disable interrupts immediately
# 0 to wait until display is blanked
DisableKPImmediately=2

QR-codes

After post about QR-codes, version without using Google Chart API.

Read more...

QR-codes

I wrote pair of scripts to tranfer small pieces of text information (e.g. URLs) from notebook to phone (Nokia N900) and vice versa.

Read more...