mirror of
https://github.com/flynx/thinkpad-keyboard-brightness.git
synced 2025-10-28 10:40:10 +00:00
13 lines
357 B
Desktop File
13 lines
357 B
Desktop File
[Unit]
|
|
Description="Turn keyboard backlight on/off based on light sensor"
|
|
|
|
[Service]
|
|
Type=exec
|
|
Environment=SENSOR=/sys/bus/iio/devices/iio:device2/in_illuminance_raw
|
|
WorkingDirectory=/sys/class/leds/tpacpi::kbd_backlight/
|
|
ExecStart=bash -c "(( $(cat ${SENSOR}) < 1500 )) && echo 1 > brightness || echo 0 > brightness"
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|