Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration file needs a bit more explanation #12

Open
aspiers opened this issue Aug 13, 2023 · 5 comments
Open

configuration file needs a bit more explanation #12

aspiers opened this issue Aug 13, 2023 · 5 comments

Comments

@aspiers
Copy link

aspiers commented Aug 13, 2023

Hi there, and thanks for this nice utility!

I couldn't easily understand some things from the README.md:

  • I see that points_count refers to the number of points in the [light] section, and that each light_n should be in the range [0..light_steps) but it's not at all obvious how these are connected. I think I figured it out by reading the source code and looking at the example config file illuminance.toml, but please let me know if my understanding is correct:
    • [0..light_steps] is a more user-friendly re-mapping of the backlight brightness scale from [min_backlight..max_brightness]
    • The illuminance_n values relate to values from the in_illuminance_raw device, which are mapped to the brightness scale via linear interpolation. So with the example values given, if the illuminance device reads a raw value of 400, that is 25% of the way between point 2 (with value 300) and point 3 (with value 700), so it gets mapped to a value of 2.25, i.e. 22.5% of the range between min_backlight and max_brightness.
    • step_barrier prevents changes of brightness if the mapped illuminance value changes less than the barrier amount, i.e. a change from 2 to 2.05 wouldn't change the backlight, but a change from 2 to 2.25 would, in which case it's effectively a noise reduction technique. But then why is the Kalman filter needed?
    • What are the parameters in the [kalman] section?
    • I think the range should be [0..light_steps] not [0..light_steps) because the example config file has light_5 = 10 implying that the maximum value of 10 is permitted.
  • <Fn> + A is supposed to switch modes, but I don't see how this is possible on my keyboard where <Fn> + A doesn't register any event? The example config has event_device_name = "Asus WMI hotkeys" which clearly won't work except for some Asus machines. How can the rest of us determine the right value?
@mikhail-m1
Copy link
Owner

Hi @aspiers,

Thanks for feedback about the documentation. I haven't touched the tool for a while and honestly don't remember much about it, unfortunatly I have had just one laptop for with a light sensor and I don't use it anymore. I will try to look at your understanding of the config and provide some feedback when I have time.
I am not sure what laptop do you use and does it have anything similar to Fn-A. But as far as I remember the same way can be used to catch any special key, obviously with some code changes. There are tools to monitor keyboard events on linux but I don't remember names.

@aspiers
Copy link
Author

aspiers commented Aug 25, 2023

Thanks for the reply! I have a Framework 13" and it doesn't have anything similar to Fn-A but it does have a Fn button. I'm aware of commands like evtest (and also showkey for virtual ttys outside Xorg) but it would be great if the docs explained how to reconfigure which special key illuminanced reacts to, because it's far from clear based on the sample config:

event_device_mask = "/dev/input/event*"
event_device_name = "Asus WMI hotkeys"

The key code for Fn-A isn't visible anywhere in that config, so I guess that must mean it's hardcoded?

@mikhail-m1
Copy link
Owner

Hey, the key is hardcodef here and Fn+A is #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ on my laptop. You can try to find another key to replace it, or combination but in this case you would need to make a bit bigger change.

@aspiers
Copy link
Author

aspiers commented Aug 29, 2023

Thanks for the info, I'll give that a go!

@mikhail-m1
Copy link
Owner

I looked at Framework 13" and Fn-Space looks like the key, so if you find right event_device_name it might work as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants