polybar / polybar

A fast and easy-to-use status bar
https://polybar.github.io
MIT License
14.19k stars 710 forks source link

Module backlight won't update as i raise/lower the brightness #1449

Closed ecesar88 closed 5 years ago

ecesar88 commented 6 years ago

Describe the issue

I installed polybar from the AUR repository and it worked perfectly until now. What happens is that when i raise the brightness using the keyboard shortcuts it does not update the percentage/bar in the module. Even if the brightness is waaaay low it keeps showing 100%/full bar.

Expected behavior:

I expected it to update the value as i raise/lower the brightness.

Actual behavior:

It doesn't update the value.

To Reproduce

I don't know exactly what it takes to reproduce this. It worked normal, as it should, then it simply stopped working.

Polybar Log

I keep getting an error in the terminal when i start polybar but i don't think it have something to do with the backlight module itself. The error is:
error tray: Failed to put tray above 0x0c00002 in the stack (XCB_MATCH (8))

UPDATE: I could solve the error, it was the system tray, i disabled it and now polybar won't output anyting when executed via a terminal. Despite this, the brightness module still don't work.

Environment:

polybar 3.2.1

Features: +alsa +curl +i3 +mpd +network +pulseaudio +xkeyboard

X extensions: +randr (+monitors) -render -damage -sync -composite +xkb +xrm +xcursor

Build type: RelWithDebInfo Compiler: /usr/bin/c++ Compiler flags: -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -Wall -Wextra -Werror -Wno-noexcept-type -O2 -pedantic -pedantic-errors Linker flags: -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now

patrick96 commented 6 years ago

You're right that error is unrelated.

Are you using the backlight or the xbacklight module? If you're using backlight, maybe try out xbacklight or check that you don't have multiple backlights: ls -1 /sys/class/backlight/

ecesar88 commented 6 years ago

Hello patrick96, and thanks for answering :) I'm using the backlight module, but i have it tested with both backlight and xbacklight, both didn't worked. I runned the command 'ls -1 /sys/class/backlight/' before configuring the module, just after i installed polybar and was still playing with it, the command output was _'acpivideo0' only, since then, i use that on the 'card' parameter, but it didn't worked either :/. I tried without passing any 'card' and 'output' values too, without success. My system video type is LVDS-1, if this can help anyway. Maybe a fresh re-install or a compilation from the source files could solve the problem? The weird thing is that it was working perfectly a few days ago... Here is my '.config/polybar/config' file: https://raw.githubusercontent.com/zSucrilhos/dotfiles/master/polybar-config i changed it a little, but was the bar colors and the icons on the eth module only.

patrick96 commented 6 years ago

Does scrolling on the module change the screen brightness?

Can you post the output of /sys/class/backlight/acpi_video0/brightness and /sys/class/backlight/acpi_video0/max_brightness when the screen is not at full brightness

ecesar88 commented 6 years ago

Yes, i tried setting scroll-enable on and scrolling, didn't worked. Yes, i can, but i'm not at home now, but as soon as i get there i'll post the output here. Many thanks. The first command i run with the max brightness possible, right? Or both with low brightness?

patrick96 commented 6 years ago

Run both with low brightness so that I can make sure it's a polybar issue and not an issue with the files containing the wrong values.

BTW. there is no enable-scroll setting in the backlight module, scrolling is always enabled, the key only exists in the xbacklight module. Can you run polybar with -l info (run polybar -l info instead of polybar when starting your bar), then try to scroll on the backlight module and then post the whole output to the terminal here.

ecesar88 commented 6 years ago

Good night! Here is the output of cat /sys/class/backlight/acpi_video0/brightness: 7 And here is the output of: cat /sys/class/backlight/acpi_video0/max_brightness: 7 I runned both commands with low brightness and the max brightness possible, it showed 7 all times. I removed the enable-scroll setting from the backlight module, thanks. Running polybar as polybar -l info gives me no output but the help one and exits. As if i runned polybar -h. Running it with only -l says error: Missing argument for option -l and exits.

patrick96 commented 6 years ago

Can you also please run cat /sys/class/backlight/acpi_video0/actual_brightness

It's strange that max_brightness is only 7, on my laptop it's 852. Right now this seems like this is an issue with your backlight card because it always provides the max brightness in the brightness file.

Running polybar as polybar -l info gives me no output but the help one and exits. As if i runned polybar -h. Running it with only -l says error: Missing argument for option -l and exits.

Oh that's not what I meant :smile: I wanted you to run polybar as you did before but now with -l info. So if before you ran polybar barname, run polybar -l info barname now.

ecesar88 commented 6 years ago

The output of cat /sys/class/backlight/acpi_video0/actual_brightness with max brightness: 7 And if i lower the brightness: 0 I also runned with medium brightness, pressed the lower brightness button 4 times from the max value: 3 Oh, haha, i got it wrong. Here it is, when i scrolled its output was: * No matching input area found (btn=5) and, in the place of (btn=5), (btn=4) when i scrolled down. I had to stop the command with Ctrl + C otherwise it would continue indefinitely.

$ killall polybar $ polybar -l info bottom

* Loading config: /home/zsucrilhos/.config/polybar/config
* Created ipc channel at: /tmp/polybar_mqueue.30726
* Loaded monitor LVDS-1 (1280x800+0+0)
* Bar geometry: 1280x29+0+771
* Starting application
* Starting module/powermenu
* Starting module/cpu
* Starting module/memory
* Starting module/mpd
* Starting module/alsa
* Starting module/backlight
* Entering event loop (thread-id=1)
* Eventqueue worker (thread-id=8)
* Configured DPI = 96x96
* Loaded font "fixed:pixelsize=10" (name=Fixed, offset=1, file=/usr/share/fonts/bitmap/dylex/6x10.bdf)
* Loaded font "unifont:fontformat=truetype:size=8:antialias=false" (name=Bitstream Vera Sans, offset=0, file=/usr/share/fonts/TTF/Vera.ttf)
* Loaded font "siji:pixelsize=10" (name=Siji, offset=1, file=/usr/share/fonts/bitmap/siji/bdf/siji.bdf)
* Loaded font "Font Awesome 5 Brands:pixelsize=10;1:antialias=true" (name=Font Awesome 5 Brands, offset=0, file=/home/zsucrilhos/.fonts/fonts/Font Awesome 5 Brands-Regular-400.otf)
* Loaded font "Font Awesome 5 Free:pixelsize=10;1:antialias=true" (name=Font Awesome 5 Free, offset=0, file=/home/zsucrilhos/.fonts/fonts/Font Awesome 5 Free-Regular-400.otf)
* Loaded font "Hack Nerd Font:pixelsize=10" (name=Hack Nerd Font, offset=1, file=/home/zsucrilhos/.fonts/Hack Regular Nerd Font Complete.ttf)
* Loaded font "MaterialIcons-Regular:pixelsize=10" (name=Material Icons, offset=1, file=/home/zsucrilhos/.fonts/fonts/MaterialIcons-Regular.ttf)
* Bar window: 0x0a00002
* Disabling tray manager (reason: missing `tray-position`)
* module/powermenu: Rebuilding cache
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* module/mpd: Rebuilding cache
* module/alsa: Rebuilding cache
* module/backlight: Rebuilding cache
* Redrawing bar window
* module/cpu: Rebuilding cache
* Redrawing bar window
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* Redrawing bar window
* module/cpu: Rebuilding cache
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* module/cpu: Rebuilding cache
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* module/cpu: Rebuilding cache
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* module/cpu: Rebuilding cache
* Redrawing bar window
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=4)
* No matching input area found (btn=5)
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* Redrawing bar window
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* module/cpu: Rebuilding cache
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* No matching input area found (btn=5)
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* Redrawing bar window
* module/cpu: Rebuilding cache
* Redrawing bar window
* module/cpu: Rebuilding cache
* module/memory: Rebuilding cache
* module/cpu: Rebuilding cache
warn: Termination signal received, shutting down...
* module/powermenu: Stopping
* Deconstruction of module/powermenu took 0 ms.
* module/cpu: Stopping
* Deconstruction of module/cpu took 0 ms.
* module/memory: Stopping
* Deconstruction of module/memory took 0 ms.
* module/mpd: Stopping
* Deconstruction of module/mpd took 5 ms.
* module/alsa: Stopping
* Deconstruction of module/alsa took 47 ms.
* module/backlight: Stopping
* Deconstruction of module/backlight took 895 ms.
* Waiting for spawned processes to end
* Reached end of application...
patrick96 commented 6 years ago

Oh, totally forgot that the backlight module doesn't support scrolling.

Looks like on your system only /sys/class/backlight/acpi_video0/actual_brightness contains the real brightness and the brightness file always stores the max brightness. According to the linux documentation backlight contains the value stored in the driver, so there may be something wrong with your driver.

But we will also look into having an option to choose to use actual_brightness instead of brightness.

EDIT: Since it was working before, this suggests that an update in your system broke/changed the backlight driver

patrick96 commented 5 years ago

This should be fixed by #1689