Making my ThinkPad LED flash 'decoded.legal' in morse code
I “wasted” my lunch break today.
Controlling your ThinkPad’s lid LED
This morning, Lennart Poettering posted a rather cool piece of information:
Did you know you could control brightness of the red dot on the i of the “ThinkPad” on the top-side of your thinkpad? I sure didn’t:
this turns it off:
echo 0 | tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness
and this turns it on:
echo 255 | tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness
I don’t really know what this information is good for, but hey, isn’t it awesome to have a 1px display on the outside of your laptop?
Making it flash morse code
So here’s a horrible but functional bash script for making mine flash “decoded.legal” in morse code:
#!/bin/bash
#-.. . -.-. --- -.. . -.. .-.-.- .-.. . --. .- .-..
function turnoff {
echo 0 | sudo tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness
}
function turnon {
echo 255 | sudo tee /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness
}
function dash {
turnon
sleep 1
turnoff
sleep 0.5
}
function dot {
turnon
sleep 0.5
turnoff
sleep 0.5
}
function pause {
turnoff
sleep 1
}
function d {
# -.. d
dash
dot
dot
pause
}
function e {
#. e
dot
pause
}
function c {
#-.-. c
dash
dot
dash
dot
pause
}
function o {
#--- o
dash
dash
dash
pause
}
function period {
#.-.-.- .
dot
dash
dot
dash
dot
dash
pause
}
function l {
#.-.. l
dot
dash
dot
dot
pause
}
function g {
#--. g
dash
dash
dot
pause
}
function a {
#.- a
dot
dash
pause
}
while true; do
d
e
c
o
d
e
d
period
l
e
g
a
l
done
Why? Sod knows.
You may also like:
- Disabling my ThinkPad's internal camera on boot
- NetworkManager: automatically switch between Ethernet and Wi-Fi
- Backing up to a USB stick automatically via udev
- Automating actions in Nautilus (GNOME's file manager) with scripts
- Debian on a £190 Lenovo ThinkPad X1 Yoga Gen 2
- I'm not sure that I can trust Bitwarden with my TOTP codes anymore
- Triggering a remote lamp automatically when I am on a call
- Snikket, a self-contained XMPP distribution
- GSConnect (KDE Connect), WireGuard, and Debian 12 Bookworm
- Unlocking a LUKS-encrypted partition via ssh on Debian 12 Bookworm
- Fixing sogo's 'incorrect string value' error
- Updating the LUKS key derivation function on Debian
- Fixing espanso incomplete text replacement
- Jabra Evolve2 40 and Debian Linux
- Enabling Webauthn in Firefox via snap