External sleep indicator 2nd edition (side led)

I made a simple script that colours one of the side leds blue when the framework laptop 13 Intel has been suspended to ram. I have tested the script with Ubuntu 24.10 and Fedora 41. It will probably work with all Intel framework laptops and with all Linux distributions under systemd and kernel 6.11 or later. I hope that someone finds this script useful.

Code:

#!/bin/sh

## location : /usr/lib/systemd/system-sleep/leds
PATH=/sbin:/usr/sbin:/bin:/usr/bin

case "$1" in
    pre)

echo 0 0 100 0 0 0 > /sys/class/leds/chromeos:multicolor:right/multi_intensity
echo 1 > /sys/class/leds/chromeos:multicolor:right/brightness

;;
    post)

echo chromeos-auto > /sys/class/leds/chromeos:multicolor:right/trigger
    ;;
esac

exit 0

Place this script in:
/usr/lib/systemd/system-sleep/ and name it e.g., leds.

Make the script executable
Code:

sudo cp leds /usr/lib/systemd/system-sleep/
sudo chmod +x  /usr/lib/systemd/system-sleep/leds

Reboot your computer.

Otto

4 Likes

This is really nice, thanks!

For anyone with an AMD laptop, the LED is under /sys/class/leds/chromeos:multicolor:charging/ instead.

1 Like