22

I have just installed Awesome WM and I have no options to change the screen brightness, and also its shortcut doesn't working. Any one can help?

1
  • 2
    You can try xbacklight.
    – Marco
    Feb 7, 2012 at 11:16

5 Answers 5

21

In the globalkeys = awful.util.table.join( section of ~/.config/awesome/rc.lua:

    -- Brightness

    awful.key({ }, "XF86MonBrightnessDown", function ()
        awful.util.spawn("xbacklight -dec 15") end),
    awful.key({ }, "XF86MonBrightnessUp", function ()
        awful.util.spawn("xbacklight -inc 15") end),
1
  • 2
    ...in the globalkeys = awful.util.table.join( section, more precisely. Sep 21, 2013 at 5:03
11

1) Install xbacklight:

sudo apt-get install xbacklight

2) Test it in console:

xbacklight -inc 10
xbacklight -dec 10

3) Add hotkeys to your awesome config ~/.config/awesome/rc.lua

Insert inside [globalkeys = awful.util.table.join] section the following text:

awful.key({ }, "XF86MonBrightnessDown", function ()
    awful.util.spawn("xbacklight -dec 15") end),
awful.key({ }, "XF86MonBrightnessUp", function ()
    awful.util.spawn("xbacklight -inc 15") end)

I use a keyboard without XF86MonBrightness* that's why I added bindings to Mod+o, Mod+p:

awful.key({ modkey,           }, "p", function ()                           
    awful.util.spawn("xbacklight -dec 15") end),                            
awful.key({ modkey,           }, "o", function ()                           
    awful.util.spawn("xbacklight -inc 15") end)                             

Hope this helps )

2
  • This worked for me. Although the response is really slow. I have about 2-5 seconds between pressing the button and the screen actually changing. Anyone know why that is?
    – Ben
    Jun 13, 2016 at 14:13
  • If xbacklight is not working for you, try these suggestions, in particular /sys/class/backlight.
    – Owen
    May 9, 2020 at 23:35
6

I autostart xfce4-power-manager, which will let you adjust the brightness using the brightness keys, in addition to general power management, such as suspend/resume, battery notifications, etc.

2

One way is to load "gnome-power-manager" inside awesome, or at awesome startup: https://wiki.archlinux.org/index.php/Awesome#Transitioning_away_from_Gnome3 Hope this helps

Another option is to run awesome inside gnome, then you can just rely on the gnome controls (working fine) and networking etc is working too http://awesome.naquadah.org/wiki/Quickly_Setting_up_Awesome_with_Gnome

1

To make an app autostart when you login in Awesome WM: Right click on Desktop go to awesome > edit config. append the following line at the end:

-- Autorun programs in Awesome WM
autorun = true
autorunApps =
{
   "xfce4-power-manager",

}
if autorun then
   for app = 1, #autorunApps do
       awful.util.spawn(autorunApps[app])
   end
end

Replace "xfce4-power-manager" with your power manager.

1
  • On systems with no DEs, is xfce4-power-manager a good choice for getting a laptop's brightness buttons working? Or, is there something even more minimal? I like your handle, btw (funny). Dec 30, 2021 at 17:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .