Skip to main content
More magic.
Source Link
wizzwizz4
  • 722
  • 6
  • 22

After 3⅓ years of putting up with my last solution, I've finally got a better one. This is for LXDE, and other DEs based on Openbox.

  1. Install brightnessctl (which should also come with a brightness-udev package):

    wizzwizz4@mylaptop:~$ sudo apt install brightnessctl 
  2. Check whether you're in the video group:

    wizzwizz4@mylaptop:~$ groups wizzwizz4 cdrom floppy sudo audio dip video plugdev netdev bluetooth lpadmin scanner 
  3. If you're not in the video group, add yourself to it and then log in again.

    wizzwizz4@mylaptop:~$ sudo usermod -aG video wizzwizz4 wizzwizz4@mylaptop:~$ lxsession-logout 
  4. Run xev to work out what your brightness keys are called:

    KeyRelease event, serial 50, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3706596, (39,62), root:(127,354), state 0x0, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 51, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3709488, (39,62), root:(127,354), state 0x0, keycode 232 (keysym 0x1008ff03, XF86MonBrightnessDown), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False 

    On my machine, and probably everybody else's too, they're called XF86MonBrightnessUp and XF86MonBrightnessDown, so you can probably skip to step 3.

  5. Edit ~/.config/openbox/lxde-rc.xml. Inside the <keyboard> section (probably at the end of it, just before </keyboard>), add the following:

     <!-- Change the brightness --> <keybind key="XF86MonBrightnessUp"> <action name="Execute"><command>brightnessctl set 6.25%+</command></action> </keybind> <keybind key="XF86MonBrightnessDown"> <action name="Execute"><command>brightnessctl set 6.25%-</command></action> </keybind> 

    Adjust to taste. I like the -e flag that comes with Debian 11 (Bullseye).

  6. Make sure you actually pressed save. (I always forget this step.)

  7. Run openbox --reconfigure to reload Openbox's configuration. (Or restart your computer – but I think this is easier.)

Tada!

Note that brightnessctl doesn't come with Wheezy; it was first introduced in Debian 10 (Buster). If you're using an older Debian, you can write a short script to increment / decrement the value stored in the relevant /sys/class/ file, and setuid root it.

After 3⅓ years of putting up with my last solution, I've finally got a better one. This is for LXDE, and other DEs based on Openbox.

  1. Install brightnessctl (which should also come with a brightness-udev package):

    wizzwizz4@mylaptop:~$ sudo apt install brightnessctl 
  2. Run xev to work out what your brightness keys are called:

    KeyRelease event, serial 50, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3706596, (39,62), root:(127,354), state 0x0, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 51, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3709488, (39,62), root:(127,354), state 0x0, keycode 232 (keysym 0x1008ff03, XF86MonBrightnessDown), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False 

    On my machine, and probably everybody else's too, they're called XF86MonBrightnessUp and XF86MonBrightnessDown, so you can probably skip to step 3.

  3. Edit ~/.config/openbox/lxde-rc.xml. Inside the <keyboard> section (probably at the end of it, just before </keyboard>), add the following:

     <!-- Change the brightness --> <keybind key="XF86MonBrightnessUp"> <action name="Execute"><command>brightnessctl set 6.25%+</command></action> </keybind> <keybind key="XF86MonBrightnessDown"> <action name="Execute"><command>brightnessctl set 6.25%-</command></action> </keybind> 

    Adjust to taste.

  4. Make sure you actually pressed save. (I always forget this step.)

  5. Run openbox --reconfigure to reload Openbox's configuration. (Or restart your computer – but I think this is easier.)

Tada!

After 3⅓ years of putting up with my last solution, I've finally got a better one. This is for LXDE, and other DEs based on Openbox.

  1. Install brightnessctl (which should also come with a brightness-udev package):

    wizzwizz4@mylaptop:~$ sudo apt install brightnessctl 
  2. Check whether you're in the video group:

    wizzwizz4@mylaptop:~$ groups wizzwizz4 cdrom floppy sudo audio dip video plugdev netdev bluetooth lpadmin scanner 
  3. If you're not in the video group, add yourself to it and then log in again.

    wizzwizz4@mylaptop:~$ sudo usermod -aG video wizzwizz4 wizzwizz4@mylaptop:~$ lxsession-logout 
  4. Run xev to work out what your brightness keys are called:

    KeyRelease event, serial 50, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3706596, (39,62), root:(127,354), state 0x0, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 51, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3709488, (39,62), root:(127,354), state 0x0, keycode 232 (keysym 0x1008ff03, XF86MonBrightnessDown), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False 

    On my machine, and probably everybody else's too, they're called XF86MonBrightnessUp and XF86MonBrightnessDown, so you can probably skip to step 3.

  5. Edit ~/.config/openbox/lxde-rc.xml. Inside the <keyboard> section (probably at the end of it, just before </keyboard>), add the following:

     <!-- Change the brightness --> <keybind key="XF86MonBrightnessUp"> <action name="Execute"><command>brightnessctl set 6.25%+</command></action> </keybind> <keybind key="XF86MonBrightnessDown"> <action name="Execute"><command>brightnessctl set 6.25%-</command></action> </keybind> 

    Adjust to taste. I like the -e flag that comes with Debian 11 (Bullseye).

  6. Make sure you actually pressed save. (I always forget this step.)

  7. Run openbox --reconfigure to reload Openbox's configuration. (Or restart your computer – but I think this is easier.)

Tada!

Note that brightnessctl doesn't come with Wheezy; it was first introduced in Debian 10 (Buster). If you're using an older Debian, you can write a short script to increment / decrement the value stored in the relevant /sys/class/ file, and setuid root it.

Source Link
wizzwizz4
  • 722
  • 6
  • 22

After 3⅓ years of putting up with my last solution, I've finally got a better one. This is for LXDE, and other DEs based on Openbox.

  1. Install brightnessctl (which should also come with a brightness-udev package):

    wizzwizz4@mylaptop:~$ sudo apt install brightnessctl 
  2. Run xev to work out what your brightness keys are called:

    KeyRelease event, serial 50, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3706596, (39,62), root:(127,354), state 0x0, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 51, synthetic NO, window 0x2a00001, root 0x78a, subw 0x2a00002, time 3709488, (39,62), root:(127,354), state 0x0, keycode 232 (keysym 0x1008ff03, XF86MonBrightnessDown), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False 

    On my machine, and probably everybody else's too, they're called XF86MonBrightnessUp and XF86MonBrightnessDown, so you can probably skip to step 3.

  3. Edit ~/.config/openbox/lxde-rc.xml. Inside the <keyboard> section (probably at the end of it, just before </keyboard>), add the following:

     <!-- Change the brightness --> <keybind key="XF86MonBrightnessUp"> <action name="Execute"><command>brightnessctl set 6.25%+</command></action> </keybind> <keybind key="XF86MonBrightnessDown"> <action name="Execute"><command>brightnessctl set 6.25%-</command></action> </keybind> 

    Adjust to taste.

  4. Make sure you actually pressed save. (I always forget this step.)

  5. Run openbox --reconfigure to reload Openbox's configuration. (Or restart your computer – but I think this is easier.)

Tada!