If you want to get notified when your Caps or Num Lock is pressed, you can install the Indicator Applet, which is an applet that displays a message indicating the status of your Caps/Num lock (On/Off). This applet is very useful, especially when you press the Num/Caps Lock inadvertently while typing, for example.
Indicator Applet Installation
The Indicator Applet is not available in the official Ubuntu repository. To install it, launch the terminal and issue these commands:
sudo add-apt-repository ppa:tsbarnes/indicator-keylock
sudo apt-get update
sudo apt-get install indicator-keylock
To start this applet, press ALT + F2, type "indicator-keylock" without quotes and press Enter.
While the applet is running, you will be notified once your Caps/Num Lock is pressed:
If you are using the Elementary theme, you can install the Elementary icon for the Indicator Applet with this command:
sudo apt-get install indicator-keylock-elementary
To start this applet automatically at Ubuntu startup, open System >> Preferences >> Startup Applications, click Add, type "indicator-keylock" without quotes in the Command text box, then click Add.