geekylthyosaur / slight

Full-featured Linux utility to control backlight brightness
2 stars 2 forks source link

TODO #5

Open geekylthyosaur opened 1 year ago

geekylthyosaur commented 1 year ago
maximbaz commented 1 year ago

I didn't want to spam you with multiple issues, allow me to confirm some things, and whatever is a relevant issue, I am happy to create separate tickets for them, if you think it's valuable.

  1. --stdout and --verbose flags exist (and are reported in --help), but they currently do nothing - I guess it is expected, according to the list above? What do you think about hiding the flags from --help, or at least adding something like **NOT IMPLEMENTED** to the descriptions?

  2. Is it expected that (starting from initial brightness 10%), slight -i apple-panel-bl '+40%' runs much faster (2 seconds in total) than slight -i apple-panel-bl '50%' (which takes 11 seconds)?

  3. Do you think we could skip asking for -i flag, when there's only one Backlight type reported in slight -l ?

  4. It would be great to clarify the meaning of --exponent flag, honestly I didn't read the code itself yet, but the description is not very clear... it feels like it should somehow control the speed of change, but it seems to be a multiplier of the change itself? I.e. starting from 1% brightness, -e 2 '+40%' only reaches 20% of brightness? (This was one of the ideas before @cyrinux started working on #6, I thought if it's meant as a speed factor, maybe providing -e 9999 would be essentially a one-step change, but I was wrong).

geekylthyosaur commented 1 year ago

Thanks for interest in my project!

  1. Yeah, right, I'll add some notice and unimplemented!() to that flags for now.
  2. I could ask you to run it using --stdout and --verbose flags but for now could you please replace setting brightness part of code with println!("{value}"); and show me the output? Also, what value is stored in your /sys/class/backlight/apple-panel-bl/max_brightness? Part of the problem could be that some devices have max brightness up to u16::MAX and iterator is created for each value from start to end with sleep between, maybe I should implement some limiting for number of possible iterations.
  3. The only mode that requires --id is --toggle. When using normal mode, if --id is not specified, the first backlight device will be selected as default. Are you sure it doesn't work without --id? What errors does it return?
  4. Device backlighting, controlled via sysfs in most cases, has a linear relationship between the value in the file and the display brightness, but because of how human vision works, a change from 0% to 5% will cause a significant change in brightness, unlike 95% to 100 % where you barely notice the change. So I created an exponential mode. When using it, the brightness change is about the same for both the 0% to 5% and the 95% to 100%, however, given that brightness is usually displayed as a linear percentage, you'll see 'wrong' values.

Feel free to open new issue if above did not help, espessially for №2!

maximbaz commented 1 year ago

Thanks for explaining, very interesting! My bad for (3), it works indeed as expected, I don't know how I was testing :see_no_evil: