I use this script using the compiz method as shown in the link you provided.
In your Compiz Configuration Settings Manager, click on the "Commands" icon.
Choose the "Key Bindings" tab. For "Run Command 0", click the "Disabled" box.
Choose "Enabled". Press the "Grab Key Combination" button and press your CAPS LOCK key.
Compiz won't view CAPS LOCK as a key combination, so just X out of the box and CAPS LOCK should now be the key combination.
caps_notify {needs sox for the play command)
Code:
#!/bin/bash
value=$(xset -q | grep "Caps Lock:" | awk '{print $4}' | grep -c on)
if [ "$value" -eq "1" ];
then
notify-send -i "/usr/share/icons/gnome/48x48/devices/keyboard.png" " Caps Lock ON" &
play -q /home/glen/Sounds/ting.wav
else
notify-send -i "/usr/share/icons/gnome/48x48/devices/keyboard.png" " Caps Lock OFF"
fi
If I login in to unity 2d with metacity as the window manager
it still works.
I used to change the mouse cursor to redglass as well
when caps was on, but changing cursors is stuffed up lately.
You may also be interested in indicator-keylock
Bookmarks