Reprogramming the LEDs for the holidays!

Hi everyone, just wanted to share this silly little holiday lights script I wrote using Dustin Howett’s ectool patches for the framework laptop. Huge shoutout to him for making the changes to ectool to allow for EC communication! The Framework Laptop's Embedded Controller (EC) :: HowettNET

Anyways, here’s the video:

If you’d like to try it for yourself, here is the script:

#!/bin/bash
function reset() {
    sudo fw-ectool led left off
    sudo fw-ectool led right off
    sudo fw-ectool led power white
    exit
}
trap reset SIGTERM SIGINT
while true; do
    sudo fw-ectool led left red
    sudo fw-ectool led right green
    sleep 0.5
    sudo fw-ectool led power red
    sleep 0.5
    sudo fw-ectool led left green
    sudo fw-ectool led right red
    sleep 0.5
    sudo fw-ectool led power green
    sleep 0.5
done

press ctrl+C to cancel the script, and it will put the lights back to normal lighting state.

fw-ectool is a alias for ectool --interface=fmw

you can compile ectool from the article above, or the Arch Linux AUR package I just created, fw-ectool-git which also includes the alias. If you’d like steps for compiling the tool on another distro, let me know (don’t bug Dustin!).

I also envision with this userspace LED control things like changing the LED based on CPU usage or something.

17 Likes

I love it! :heart_eyes:

(…10 character limit…)

Wow, super cool! I wanted to see a better light color that is good for my eyes. The default white color light is too stimulating for my eyes.

1 Like

Related thread: Exploring the Embedded Controller . Thanks, DHowett!

4 Likes