There is already an application that attempts to do this called indicator-keylock. You need a PPA to install it:

sudo add-apt-repository ppa:tsbarnes/indicator-keylock
sudo apt-get update
sudo apt-get install indicator-keylock
setsid indicator-keylock  # to run it the first time


But I'd be interested to see if there's a neat way to bind onto these lock-toggle events.

How to get caps/num/scroll lock keys OSD notification?
Like everyone else in the world, I'm following this hadoop tutorial. I get to the point where I format HDFS, and I get this:

user@linux01:~$ sudo $HADOOP_INSTALL/bin/hadoop namenode -format
Error: JAVA_HOME is not set.


Well that's funny, I set JAVA_HOME in my /etc/profiles.

user@linux01:~$ tail -n 4 /etc/profile
export JAVA_HOME=/usr/local/jdk1.6.0_32/bin
export JDK_HOME=$JAVA_HOME
export PATH=$PATH:/usr/local/jdk1.6.0_32/bin
export HADOOP_INSTALL=/usr/local/hadoop/hadoop-1.0.3


Did I mess that up somehow?

user@linux01:~$ echo $JAVA_HOME
/usr/local/jdk1.6.0_32/bin
user@linux01:~$ ls $JAVA_HOME
appletviewer  extcheck       jar        javac    and so forth...


Seems to work. Maybe it absolutely has to be set in my hadoop-env.sh?

# The java implementation to use.  Required.
export JAVA_HOME=$JAVA_HOME


Lazy, yeah, but I still get "JAVA_HOME is not set" with or without this comment. I'm running low on ideas. Anyone see anything I'm missing?
