Controlling the LEDs¶
All of the capabilities listed on this page require the Librem EC ACPI DKMS driver to be installed.
Camera / Microphone¶
The LED next to the camera / microphone hardware kill switch will be on when camera and microphone are enabled, and off otherwise. It is hardwired to the power supply of the camera and microphones.
Wi-Fi / Bluetooth¶
The LED next to the Wi-Fi/Bluetooth LED is a bit different. This one is not only hardwired to the switch state but when the switch is on, it can also be controlled by the Embedded Controller (EC).
In default mode it will be on when Wi-Fi/Bluetooth is enabled (powered), and off otherwise.
This LED is exposed in the virtual sys filesystem at:
/sys/class/led/librem_ec\:airplane
Note
There are reasonable defaults, so you do not have to do anything, unless you want to take over control and customize your hardware’s behavior to your wishes.
Like all Linux LEDs the LED can be assigned to a so called trigger, i.e. a Linux kernel driver that can automatically change the state of the LED based on certain events. By default, the Librem EC ACPI driver will assign the “rfkill” trigger to the LED, which means that if the radio is switched off from Linux using the rfkill framework (e.g. by disabling it from the graphical user interface) the LED will also turn off!
Monitor Network Activity¶
With this trigger you can configure a network interface to monitor and if the RX or TX (or both) queue are triggering a ‘blink’ of the LED.
A script like the following will let your Wi-Fi/Bluetooth LED blink whenever there is traffic on the Wi-Fi interface:
modprobe ledtrig-netdev
echo netdev > /sys/class/leds/librem_ec\:airplane/trigger
echo wls6 > /sys/class/leds/librem_ec\:airplane/device_name
echo 1 > /sys/class/leds/librem_ec\:airplane/rx
echo 1 > /sys/class/leds/librem_ec\:airplane/tx
Tip
This can provide you an idea of how much data is flowing — the more it blinks, the more data is being transmitted.
LED Brightness¶
You can use the LED with your own programs or scripts by writing 0 or 1 to /sys/class/leds/librem_ec\:airplane/brightness.
Notification¶
The notification LED is a triple LED with red, green, and blue (RGB). Each color can be controlled individually in 255 brightness steps – not just 0 or 1. Theoretically you have 255*255*255 colors to choose from.
In practice there are fewer colors since not all LEDs have a visible brightness at low levels. In particular, blue is comparably dark so the color yield is a bit less. This is pretty normal for RGB LEDs and is also rooted in the perceived brightness through the human eye, among other things. To give you an idea: to get something pretty close to a neutral white you need to set red:90, blue:200, and green:255.
The three colors can be accessed through the LED interface in the sys filesystem at:
/sys/class/leds/red\:status
/sys/class/leds/green\:status
/sys/class/leds/blue\:status
Brightness for each of the LEDs range from 0 to 255.
To turn on the red LED at maximum brightness, run:
echo 255 > /sys/class/leds/red\:status/brightness
CPU Load¶
The notification LED colors can be used with triggers, with all the triggers the kernel offers.
Here is a red heartbeat, getting faster with CPU load:
modprobe ledtrig-heartbeat
echo heartbeat > /sys/class/leds/red\:status/trigger
Dimming Glow Pattern¶
Here is a green LED with a glow dimming pattern:
modprobe ledtrig-pattern
echo pattern > /sys/class/leds/green\:status/trigger
echo 0 1000 255 1000 > /sys/class/leds/green\:status/pattern
Keyboard Backlight¶
The keyboard backlight can be accessed through the LED interface in the sys filesystem at:
/sys/class/leds/librem_ec\:kbd_backlight/brightness
The values you can write to this can range from 0 to 255, with 255 being maximum brightness.
For example, to turn off the keyboard backlight:
echo 0 > /sys/class/leds/librem_ec\:kbc_backlight/brightness