Friday, June 25, 2010

realtime caps lock and num lock notification in ubuntu

My response for thread at ubuntu forum. Python notification-osd examples helped a lot.

Finally the notification is real tnotification-osd examplesime. I used the update method call from notify-osd using python. I needed a service to run in the background, which can independently create and modify notifications, and two trigger scripts to call the service by dbus.

The dbus service, and two calling scripts were called by python. I used the same xset code in the first reply to get the status of locks.

The archive contains the following files:

1. lock_keys - Service python script, must be running for real-time notification toggle. This require caps shell script for usage.

2. lockNum - trigger python script, used as keyboard binding for num lock.

3. lockCap - trigger python script, used as keyboard binding for caps lock.

4. caps - shell script to identify the status of locks.
USAGE:
$> caps caps
$> caps num

The way to install this is to navigate to download directory and run the following commands:
Quote:
$> tar -xvzf lock_Notify.tar.gz
$> cd lock_Notify/
$> chmod a+x *
$> sudo mv * /bin
[sudo] password for user:

Now open System -> Preferences -> Startup Applications
Add /bin/lock_keys to startup.

Open System -> Preferences -> CCSM,
Add command 1 = lockNum
Add command 2 = lockCap
And add num lock and caps lock shortcuts to these commands from CCSM.

No comments:

Post a Comment