Created
November 27, 2019 01:20
-
-
Save crabdancing/63cd9736f4f608047bc7aac58581438c to your computer and use it in GitHub Desktop.
Some example code for controlling keyboard backlight on Dell laptops via sysfs and pathlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from pathlib import Path | |
import time | |
sysfs_path = Path('/sys/devices/platform/dell-laptop/leds/dell::kbd_backlight/brightness') | |
for i in range(4): | |
print(i) | |
time.sleep(1) | |
# write 0 to turn off backlight | |
# write 3 to turn it up to max | |
sysfs_path.write_text(str(i)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment