Issue with brightness keys

Hi all,

Today I installed BSPWM. All good, still learning about it, but atm main issue is with brightness keys.

F2/F3 doesnt work. Same with FN combo.

I tried this :
pacman -S acpilight

to get it working from terminal with the command :
sudo xbacklight -dec 20

Next one :

*> [marko@marko-hpenvyx360convertible13ar0xxx ~]$ xmodmap -pke | grep Bright*
*> keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown*
*> keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp*
*> keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown*
*> keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp*
*> keycode 251 = XF86MonBrightnessCycle NoSymbol XF86MonBrightnessCycle*

I dont know what to do next. Same issue I had with i3.

F2/ F3 combo working on other DE.

About my hardware : http://ix.io/3oFl

Thank you in advance,

If you can do what you want with a terminal command, then you should be able to set up a keybinding for it. Are you using sxkhd?

yes

Add something like this to the sxhkdrc file:

F2
sudo xbacklight -dec 20

I added it , reseted BSPWM , but nothing happened.

In sxhkdrc file I already have this :

# Brightness up
XF86MonBrightnessUp
  xbacklight -inc 5

# And brightness down
XF86MonBrightnessDown
  xbacklight -dec 5

Blockquote

Does entering the xbacklight -dec 5 command in the terminal lower the lighting like you want?

yes, it does

I would use the sxhkdrc file to bind that to some key combo then. It’s possible that the F2 I had you use before wasn’t correct. I’m not on a bspwm machine at the moment to check. Try something like:

alt + shift + b
xbacklight -dec 5

To test that the keybinding works and then we can work to update the alt + shift + b part to use the F2/F3 key like you really want.

sorry it took me longer, because I tried to theme my bspwm and I needed to install it again…hehe

about this, I added this to sxhkdrc file, restarted bspwm and nothing… no respond

Not sure if at this point I’m digging up an old thread or taking forever to respond, but…

If you can get that key combo to do something else (open your normal terminal, for example) and the xbacklight -dec 5 command in the terminal does the backlight change you want it to, then we know the keybinding works and the command works, so I have no idea why they wouldn’t work when put together.

1 Like

I dont know… hehe…

I am thinking to make a script for inc/dec brightness, and then bind them to key combo.

But yeah, first need to google how to do it…

Or even switch from bspwm to xfce/i3…

Still exploring my options :wink:

After all tries, still dont have working brightness keys.

How can I make script or bind those script or something even more easier for command :
sudo xbacklight -dec/inc 20

for what it worth…
on an HP laptop, i had to force a power reset: https://support.hp.com/ph-en/document/c01684768
i.e. computer off, remove all cables, press and hold power button for 15 seconds. Turn the computer on and reconnect the cables. The brightness buttons then were working.

Before that, the brightness buttons (specials keys F3 F4 + Fn) were both returning the same keycode as mute (Fn+F8)

Of course before stepping on that I tried all the acpi_backlight= possible and couldn’t remap those exact keys as theirs keycodes were all the sames

Might worth a try… (each time i booted in Zindozs, i had to repeat the forced reset…)

Edit: as you could guess it was dual booting w/ windows

1 Like

Don’t know if this helps as I use i3 and no BSPWM but this is how it is handled in i3:

# Backlight control
bindsym XF86MonBrightnessUp exec xbacklight +10
bindsym XF86MonBrightnessDown exec xbacklight -10
1 Like

I tried this, but no help …still the same

Atm I have this :

> # Brightness up
> XF86MonBrightnessUp
>   xbacklight -inc 5
> 
> # And brightness down
> XF86MonBrightnessDown
>   xbacklight -dec 5

but that doesnt work…
In terminal working command is : `

sudo xbacklight -inc 20

`

Have you tried binding it to a different key combo? If you can get it to work on another key combo, then we know the issue is the naming of the key you are using.

Yes, I tried it already… still the same

have you tried brightnessctl package?
you can read the manual here
just a quick example

brightnessctl set +10 
brightnessctl set 10-

edit (explanation added): for some reasons i had your problem and the only workaround for me was brightnessctl, i tried other methods light xbacklight etc but didn’t with binding idk why

1 Like

I tried, working in terminal :slight_smile:

[

marko@marko-hpenvyx360convertible13ar0xxx ~]$ brightnessctl set 10-
Updated device 'amdgpu_bl0':
Device 'amdgpu_bl0' of class 'backlight':
	Current brightness: 235 (92%)
	Max brightness: 255

Blockquote