One tiny mistake I made: it’s wFF not W255 … I don’t know why I assumed decimal number format.
So the actual command to remap the Caps-lock key to fn is: ectool raw 0x3E0C d1,d1,b4,b4,w255
(and to reverse it: ectool raw 0x3E0C d1,d1,b4,b4,w58 back to normal)
in Fedora 41, kernel 6.11 the keyboard backlight brightness is exposed through /sys/class/leds/chromeos::kbd_backlight/brightness and can be changed with the command
But in contrast to my Thinkpad, no osd (on screen display indicator) appears when changing the keyboard backlight with the keyboard (fn + space). And, after changing the keyboard brightness with these keys, it does no longer correspond with Gnome settings.
Can someone tell me what is needed to fix this, how to enable the osd when changing the keyboard backlight with the fn+space keys.
Perhaps a potential solution is for the Gnome app to periodically poll the EC/sys/class/leds/... for the current state while the app is open. Maybe once per second.
I am not familiar with what is available in the EC API/ABI or Gnome programming but it may be a direction to investigate.
If you close and re-open the Gnome settings app does it show the current state as set by the keyboard input? That may show that the app looks at the settings when started. If it stays out of sync then it may indicate that the app sets but never looks at the state for the keyboard backlight.
However, the value in /sys/class/leds/chromeos::kbd_backlight/brightness
is changed when pressing fn+space. Can this change not be used to trigger a notification? Or is it perhaps possible to modify the EC firmware? (I am not a developer, I am only a Linux user.)
No. The kernel only reads this from the EC when triggered by userspace.
Gnome could/should reread it before evaluating its own hotkeys.
This will not fix the UI but make the gnome shortcuts usable.
But I specifically looked for an notification mechanism in the EC and didn’t find anything.
So I doubt Windows can provide this.
The EC handling Fn+Space is a Framework specific addition to the EC. On real Chromebooks this seems to be all handled in the OS, so no notification is necessary in the first place.
I think this would require a mode change. Where an OS that supports handling keyboard brightness switches the mode of the EC. Then it should forward the fn+keypress instead of capturing it and handling it in the EC autonomously.
Reset this mode on boot.
Would be interesting if that is what other manufacturers do. That or they’d need a separate channel for the events. Because my Dell notebooks can still change the keyboard backlight via keyboard if the OS is not handling it…
Thank you very much for making a patch. If this patch has been tested and works, is it possible for me to try it out? I am not a developer, and do not own a chrome book. A chrome book is required to compile the source code I understand.
Can you give e.g., a link to instructions and binaries so that I can use your solution? I will appreciate that.
I’m on an AMD|16"|Win11 configuration, I’d rather not mess with Secure Boot, and I want to set the battery’s charge limit from the OS. If my re-reading of this thread is correct, I should be able to set charge limits via @TomsonTom 's WinRing0 branch of @DHowett ectool build, at PR1
Is something holding back the merge of that PR? There haven’t been commits since it was opened some months ago, but it’s also not merged yet. I have limited experience with C++ projects, so I’d rather just download an artifact from GitLab than try to CMake the branch myself
Hi, thank you for your interest! I think it was never merged because @DHowett is busy and there didn’t seem to be that much interest from the community. A few people liked it and probably built it themselves. I suggest that you try to build it, it’s really not that hard and my pull request also contains a tutorial on how to run the WinRing0 version.
Latest coreboot just landed in unstable, which brings us up to speed with that upstream at least. It doesn’t give me all the goodies like chargecontrol here, as that still seems to be specific to the fork and not available in upstream coreboot code (which, frankly, is kind of unfortunate).
There is, however, more drivers in the kernel itself. The module mentioned in Exploring the Embedded Controller - #158 by DHowett (cros_ec_lpcs.ko) is available, and I think that brings me LED controls? It’s not exactly clear to me what this module does because the source code actually talks about keyboard control, so I’m not sure what that thing does (nor why I need to load it manually):
modprobe cros_ec_lpcs
Anyways, something in newer kernels brings with it a bunch of LED controls:
The multi_index file shows what the various digits are used for:
$ cat /sys/class/leds/chromeos\:multicolor\:power/multi_index
red green blue yellow white amber
There’s also a cros_charge-control module, and apparently it’s supposed to work with the latest framework laptops, but attempts at adding support for it in TLP seems to have failed:
I can also confirm that I don’t see the /sys/class/power_supply/BAT1/charge_control_end_threshold file here, after loading the module.
So that’s what I got: LED control works, which is cool, although I’d like to have better control over how the EC changes the LED colors when charging. Specifically: i’d like a better “rainbow”, ie:
< 20% red
< 50% amber
< 80% white
> 80% green
100% white
right now, it seems we only do amber and white.
And, of course, i’d like to be able to control the charge limit. Ideally, I’d switch it to 100% when i’m undocked or have some way to trigger that more easily.