Lock Minimum brightness to prevent screen turning off
Xbacklight doesn't prevent the backlight from turning off, which some users have found a use for, but can sometimes require a ssh connection, a reboot, or blind typing on a terminal to fix if the keyboard keys haven't been linked to an xbacklight call.
1rst solution:
A way to fix that would be an optional argument to keep the brightness value at a minimum of 1.
(xcb_randr_query_output_property_valid_values
usually considers 0 as a valid value as far as I can tell, which in most cases, will turn off the backlight. I have not found a case where this is not true, but I am not 100% sure this is the case.)
This way, users that make use of the fact that xbacklight will turn off the screen won't see its behavior changed, but users with a need to keep the backlight on will have the option.
Problem: One issue with that is that there is no guarantee that a value of 1 will keep the screen on, I have had a laptop whose lowest I could go before the backlight turned off was 40...
2nd solution: An optional argument specifying the minimum value to set the brightness to. Same behavior as before for users who don't need the limit.
Problem: Different screens might have different turn-off and maximum values. As mentioned before, my old laptop turned off at 40, whereas from what I read on other issues, Toshiba Satellite L650D have a maximum backlight value of 7... I have not encountered a situation where xbacklight was capable of controlling multiple screens (either the screens I had didn't support the connected computer controlling the brightness or something else...) and I don't know how this would behave...
3rd solution: An optional argument to specify the minimum brightness for each specific screen...
Problem: This is starting to get pretty involved, and doesn't take into account the fact that a screen might change ports, and screen can't be reliably uniquely identified afaik (edid doesn't necessarily have all the info to uniquely identify a screen from what I've seen) Best we can do is specify the ports (eDP1 or DP-1, things like that) or maybe fingerprint the screens with the various info we have... But that's already way outside the scope of xbacklight...
So I don't have a one size fits all solution, which is why I haven't written the code myself, I simply don't know what to do with it...