Ubuntu – Keyboard LED panel indicator for Unity Desktop

capslockindicatorkeyboardnumlockunity

I own a notebook running Ubuntu 16.04 with Unity DE that does not have any keyboard LEDs to indicate NUM-Lock or CAPS-Lock states.

It would be useful for me to see them anyway, ideally through an indicator in Unity's panel.

Please note that I only want to see the states of NUM-Lock, CAPS-Lock and optionally Scroll-Lock. I do not want to see whether any other modifier keys like Shift, Ctrl, Alt, Super etc. are currently pressed. I only want a replacement for my missing LEDs.

Are there any working indicators available?


I already have read How to add a keyboard modifier state applet to Unity panel?, but it does not suit my needs. indicator-xkbmod only displays a wrong icon but does not react on keyboard NUM-/CAPS-Lock status changes, kbstate is for KDE only and key-mon does not show the NUM-/CAPS-Lock states but indicates key presses to modifier keys.

Best Answer

I have also written an application indicator which, in my opinion, looks better.

indicator-keyboard-led

It shows the state of the locks using filled/unfilled circles.

indicator default
Default appearance of the indicator with Num lock on and Caps and Scroll locks off.

indicator menu
Menu of the indicator, shown on click. The locks can be toggled by clicking the respective item in the menu.

indicator short
Alternative (short) appearance of the indicator.

indicator CNS indicator NC indicator C short
You can also change which locks are displayed and in what order.

Installation:

sudo add-apt-repository ppa:adrianiainlam/indicator-keyboard-led
sudo apt-get update
sudo apt-get install indicator-keyboard-led

After installation the postinst script will prompt you for preferences configuration. Visit the GitHub repo for full explanation on these settings.

Usage:

The indicator will be configured to autostart on log-in. To start using the indicator after installation, log-out and log-in again, or manually start the indicator (search for "indicator-keyboard-led" in the dash).

The indicator should be shown at the top right corner, with a filled circle representing a lock turned on and an unfilled circle representing a lock turned off.

Clicking on the indicator should result in a menu with the three locks. Clicking on the menu item would cause the corresponding lock to toggle.

Bug reports and feature requests welcome.

Related Question