You are not logged in.

#1 2016-09-28 02:36:35

BlahBlahBlase
Member
From: Tucson, AZ
Registered: 2015-09-15
Posts: 35

[SOLVED]xbacklight minimum brightness- i3WM

I read through the arch wiki and it seems there is a way to set the maximum brightness. What I'm wondering is if it is possible to set a minimum brightness? What I would like is for when I turn my brightness all of the way down, I want it to stop at a brightness just below 0. Though ideally, I would be able to set the brightness below 0 then when I set it back up, the first value it uses is 0 (which is actually something like 0.229 or whatever)

I am using i3 and have set a bindsym to increase and decrease brightness by by 10 on each key push but for some reason, it wont stay at an interval of ten. For example: If I'm at ten percent brightness and decrease it to 0, my screen is still on, but if I I decrease my brightness past 0 then increase it again, my brightness value becomes 9. I attribute this to the actual brightness being a float value. So what I'm wondering is if there some way through xbacklight or my i3 configuration to allow me to both turn my brightness off and then when it's incremented positively, it starts at 0. Do I need to write a script for this and if so, where should I start?

My i3 configuration as it pertains to brightness:

#Brightness controls
bindsym XF86MonBrightnessUp exec "xbacklight -inc 10 ; pkill -RTMIN+1 i3blocks"
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10 ; pkill -RTMIN+1 i3blocks"

Thanks in advance!



edit: I managed to get at least close to the desired result by setting my increase percent to 11 and leaving my decrease value at 10. Now I can turn my brightness all the way down to turn my screen off. And now if I increase from the black screen then decrease again, I can reach the minimum brightness of 0 (or a few decimal places above 0 that is). This was important to me as my partner likes to fall asleep with the computer playing netflix and 10% brightness still managed to illuminate the whole room and make it hard for me to sleep.


edit2: I also wrote a simple bash script to better handle this problem. PM me if you're interested. It's a lot cleaner than my previously mentioned fix.

Last edited by BlahBlahBlase (2016-09-28 21:27:05)


"Full disclosure, I'm drunk right now. And if you can't handle that, you can't handle science."

Offline

#2 2017-03-12 14:59:01

dported
Member
Registered: 2017-03-12
Posts: 1

Re: [SOLVED]xbacklight minimum brightness- i3WM

Hello @BlahBlahBlase!
I think I am unable to send You PM, but I am interested in Your script, because I suffer from the same issue and I am now using Your +11/-10 workaround, but as You have said, it's not perfect. Could You please upload it to pastebin or something, so I am not the only one who can use it (if You would have send it to me by email or sth)? Thanks a lot in advance, cheers.

Offline

#3 2017-03-12 16:06:44

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED]xbacklight minimum brightness- i3WM

To turn backlight off you can use

 xset dpms force off 

It will turn automatically on when any key is pressed.

Offline

Board footer

Powered by FluxBB