VoltaireNoir / blight

A hassle-free CLI utility/library to manage backlight on Linux; one that plays well with hybrid GPU configuration and proprietary drivers.
23 stars 1 forks source link

Read device files from `/sys/class/leds/` #7

Open ritiek opened 9 months ago

ritiek commented 9 months ago

Hi, thanks so much for making blight! I've been using it indirectly with SwayOSD.

I've got an ASUS laptop which has Screenpad 2.0 (trackpad as a second display) as well as got keyboard backlighting. It's got these device files respectively for it under /sys/class/leds/:

$ ls /sys/class/leds
asus::screenpad
asus::kbd_backlight

both these subdirectories have brightness and max_brightness files too.

For experimenting with blight, I changed the following line to /sys/class/leds: https://github.com/VoltaireNoir/blight/blob/37a65797a9806a5d91626f6ac7155bd70d645e09/src/lib.rs#L54 and I was able to control both trackpad display's brightness as well as keyboard backlighting respectively fine using:

$ blight inc 10 -s -d asus::screenpad
$ blight inc 100 -d asus::kbd_backlight

Is it planned to include device files from /sys/class/leds/ (in addition to /sys/class/backlight/) here in blight's main source repo?

VoltaireNoir commented 9 months ago

Hi, I'm really glad you're finding blight useful.

I did realise that the interface to control LEDs is similar. Yes, the plan is to eventually add support for them in blight, hopefully in the next release.

But I don't know when that will be, because I'm somewhat occupied with work and other projects. PRs are always welcome :)