.. include:: /urls.rst .. _l14_led: Controlling the LEDs ==================== All of the capabilities listed on this page require the :ref:`Librem EC ACPI DKMS driver ` to be installed. .. _l14_led_cam_mic: 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. .. _l14_led_wifi_bt: 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: .. code-block:: /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! .. _l14_led_network_activity: 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: .. code-block:: bash 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. .. _l14_led_brightness: 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``. .. _l14_led_notification: 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: .. code-block:: /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: .. code-block:: bash echo 255 > /sys/class/leds/red\:status/brightness .. _l14_led_cpu_load: 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: .. code-block:: bash modprobe ledtrig-heartbeat echo heartbeat > /sys/class/leds/red\:status/trigger .. _l14_led_glow_pattern: Dimming Glow Pattern ^^^^^^^^^^^^^^^^^^^^ Here is a green LED with a glow dimming pattern: .. code-block:: bash modprobe ledtrig-pattern echo pattern > /sys/class/leds/green\:status/trigger echo 0 1000 255 1000 > /sys/class/leds/green\:status/pattern .. _l14_led_keyboard_backlight: Keyboard Backlight ------------------ The keyboard backlight can be accessed through the LED interface in the ``sys`` filesystem at: .. code-block:: /sys/class/leds/librem_ec\:kbd_backlight/brightness .. raw:: html Since this interface is a common interface in Linux, user interfaces like GNOME pick them up. FOr example, feedback is provided on the screen when the keyboard backlight is toggled by the hotkey (Fn + F4) and the keyboard backlight will get switched off when the screen saver kicks in and switches off the LCD. 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: .. code-block:: bash echo 0 > /sys/class/leds/librem_ec\:kbc_backlight/brightness