Skip to content

Instantly share code, notes, and snippets.

@theodric
Last active October 23, 2025 20:38
Show Gist options
  • Save theodric/10e2da12576473a7d2062da2c90a2b1e to your computer and use it in GitHub Desktop.
Save theodric/10e2da12576473a7d2062da2c90a2b1e to your computer and use it in GitHub Desktop.
thinkpad LED control service/script
twinkpad:/sys/devices/platform/thinkpad_acpi # cat /etc/systemd/system/tpled.service
[Unit]
Description=Custom LED Trigger Setup
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/root/bin/tpled.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
twinkpad:/sys/devices/platform/thinkpad_acpi # cat /root/bin/tpled.sh
#!/bin/sh
echo phy0tx > /sys/class/leds/tpacpi\:orange\:batt/trigger
echo phy0rx > /sys/class/leds/tpacpi\:green\:batt/trigger
echo none > /sys/class/leds/platform\:\:mute/trigger
echo none > /sys/class/leds/platform\:\:micmute/trigger
echo 0 > /sys/class/leds/platform\:\:mute/brightness
echo 0 > /sys/class/leds/platform\:\:micmute/brightness
echo 0 > /sys/class/leds/tpacpi\:\:lid_logo_dot/brightness
#echo block-activity > /sys/class/leds/tpacpi\:\:power/trigger
twinkpad:/sys/devices/platform/thinkpad_acpi # cat /usr/lib/systemd/system-sleep/lid-led-offswitch.sh
#!/bin/bash
case $1/$2 in
post/*)
echo 0 > /sys/class/leds/tpacpi::lid_logo_dot/brightness
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment