Hummer12007 / brightnessctl

A program to read and control device brightness
Other
900 stars 48 forks source link

--min-value prevents all value changes #82

Open SavageMessiah opened 1 year ago

SavageMessiah commented 1 year ago

I'm trying to use --min-value in order to keep something like brightnessctl set 5%- from turning my screen off. However it seems that setting --min-value is preventing ANY change from happening, even if it is above the minimum specified.

~
❯ brightnessctl set 10000
Updated device 'intel_backlight':
Device 'intel_backlight' of class 'backlight':
    Current brightness: 10000 (10%)
    Max brightness: 96000

~
❯ brightnessctl --min-value 5000 set 7000
Device 'intel_backlight' of class 'backlight':
    Current brightness: 10000 (10%)
    Max brightness: 96000

~
❯ brightnessctl --min-value 5000 set 1%-
Device 'intel_backlight' of class 'backlight':
    Current brightness: 10000 (10%)
    Max brightness: 96000

~
❯ brightnessctl --min-value 5000 set 1%+
Device 'intel_backlight' of class 'backlight':
    Current brightness: 10000 (10%)
    Max brightness: 96000

~
❯ brightnessctl --min-value 5000 set 11000
Device 'intel_backlight' of class 'backlight':
    Current brightness: 10000 (10%)
    Max brightness: 96000
rodericasm commented 1 year ago

not a fix, but i got around this by having an external script that clamps the set value between min and max. dirty but it works.

jrollins commented 1 year ago

I'm also experiencing this issue, it seems that the --min-value option is broken.

neuromagus commented 1 year ago

yep. --min-value not work.

jrollins commented 1 year ago

I think I have a work around. I haven't looked at the code, but I think the problem is related to the argument parsing. I seem to have gotten it to work if I use the long form of the option, and I specify the minimum value in absolute units instead of as a percent. So this command seems to be doing the correct thing for me:

brightnessctl set --min-value=150 1%-

With that command it does actually bottom out at a brightness level of 150.

neuromagus commented 1 year ago

thanks.