pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.44k stars 85 forks source link

GNOME Panel brightness slider does not work on Desktop #73

Open ahoneybun opened 6 years ago

ahoneybun commented 6 years ago

If this is a bug, please use the template below. If this is a question, or a general discussion topic - please post on our subreddit https://reddit.com/r/pop_os - as that is the proper forum for those types of posts.

Reporter info

 * Distribution - (run ```cat /etc/os-release```)
 * Related Application and/or Package Version - apt policy $PACKAGE NAME

Pop!_OS

Issue/Bug Description

The Meerkat had a display brightness slider but it does not work

Steps to reproduce (if you know)

User slider in top right menu in GNOME

Expected behaviour

Display to darken or brighten depending on where the slider is dragged to

Other Notes

WatchMkr commented 6 years ago

It appears GNOME presumes a display connected via an embedded port must be a laptop. This is similar to laptops with external displays attached - the brightness control appears even though it's not adjustable.

soulfoam commented 6 years ago

I am running a 3 monitor setup, and the brightness slider is actually crashing the entire system if I touch it. It's pretty annoying, is there anyway to disable the brightness slider through some sort of setting, or running some command?

I've got a NVidia 970 GFX card.

hugomilan commented 6 years ago

I have the same issue on my Oryx Pro. My laptop screen brightness does not change when the slider is changed or when the keyboard shortcut is pressed.

hugomilan commented 6 years ago

I have found a workaround. First, I installed xbacklight sudo apt install xbacklight Then, I change the brightness using with xbacklight -set XX where XX is the percentage of backlight you want. For example, for minimum backlight, you can use xbacklight -set 0

I also tested other solutions online (such as this that did not work and changing --brightness with xrandr). I thought xbacklight was the most efficient workaround because it did not affect the color scheme changed by the night light mode.

Maybe one possible solution to the slider (and brightness keys) problem would be to link it with xbacklight. Anyone have any idea on how to implement that?

dragonbite commented 6 years ago

When I was fooling around with OpenBox recently (although it was on Lubuntu I was looking over the documentation here https://fedoramagazine.org/openbox-fedora/ ) and I installed xbacklight like you did, but I didn't have to do anything else. My keyboard just started using it.

I don't remember if I had to log out or restart to make it "connect".

If you can run something like xbacklight -set +10 or something like that then you should be able to bind the key combination, hopefully with the fn key, to increase or decrease by a set amount (maybe do 5 instead of 10).

hugomilan commented 6 years ago

I restarted it but the key/slider didn't work. Maybe one of the other packages on the link you gave could fix it? I'm not sure what OpenBox is and I'm happy with how my system is now so I'm not willing to mess around with several packages =). I might, though, try to mess around with key commands latter.

dragonbite commented 6 years ago

I'm not suggesting you start or try using OpenBox. Because OpenBox is basic and does not bundle with a lot of applications and settings to make things easier like Gnome does, I thought it may mention some packages that most people don't know is what is going on "under the hood", so to speak.

Ok, so xbacklight didn't fix it or automatically bind like I was hoping it would. I'm not in front of my Linux desktops to see if in the documentation (man xbacklight) it says anything about setting the brightness by a factor based on the current settings (example its set at 100% and then the command sets it -10% of that, or to 90%), rather than have to enter a set value.

If you can run it incrementally rather than only be able to enter the value, then you can bind the key to the command to set it up/down an increment. But this is beyond me without my computer in front of me to break (er, I mean try out things) :)

hugomilan commented 6 years ago

Thanks! Yes, xbacklight does have these options (-inc and -dec). I tried to set them up as a shortcut but I can't get it to add Fn + F9 (the little brightness screen indicator appears and the add key to shortcut don't recognize Fn + F9). So, I tried to google around for what is called when I press the keys to change brightness because, on that case, I could just fix it on that file but I didn't find it anywhere (google was only showing my how that I should add it as a shortcut, which didn't work).

I looked at Pop source code but didn't figure out where the code for brightness was =(

vcfxb commented 6 years ago

I am also having this issue on my oryx pro. (oryxp1)

hugomilan commented 6 years ago

I didn't find any fix beside using xbacklight on the terminal. You could try it for a temporary fix.

vcfxb commented 6 years ago

I fixed it. my system 76-driver-nvidia package was not installed for some reason...

hugomilan commented 6 years ago

I also didn't have this package installed and, after installing, it fixed.

sarmadka commented 6 years ago

Have the same problem with my Oryx Pro. It's a Gnome issue that exists on all distros, not just Pop OS. KDE works fine on the other hand. I fixed it by running the following small script in the background. The script simply listens to changes in the brightness value and calls xrandr (or it can also use xbacklight) to apply the value.

#!/bin/bash
max=/sys/class/backlight/acpi_video0/max_brightness
level=/sys/class/backlight/acpi_video0/actual_brightness
factor=$(awk '{print $1/100}' <<< $(<$max)) 

xblevel() { awk '{print int($1/$2)}' <<< "$(<$level) $factor"; }
#xbacklight -set $(xblevel)                                                                                       
xrandr --output DP-0 --set Backlight $(xblevel)                                                                   

inotifywait -m -qe modify $level | while read -r file event; do                                                   
    # xbacklight -set $(xblevel)                                                                                  
    xrandr --output DP-0 --set Backlight $(xblevel)                                                               
done

I'm not on Gnome anymore, but last I checked installing system76-driver-nvidia doesn't solve the issue.

sarmadka commented 6 years ago

The same issue still exists on Pop OS 18.04. Pop OS should work flawlessly out of the box on System76 hardware, otherwise what's the point? Might as well stick to Ubuntu if we need to apply tweaks to get such basic functionalities to work.

AlexHalbleib commented 5 years ago

Just got a Galago Pro yesterday (2019-01-02), and my brightness slider is working well. I have Pop!_OS 18.10, with GNOME 3.30.2

hugomilan commented 5 years ago

Mine is work well too. I don't quite remember what I did but I guess my distro was missing system76 nvidia package. BTW, I guess this thread could be closed.

4SeasonsFlow commented 4 years ago

i have a laptop with amd ryzen 4500u (lenovo ideapad 5) processor. Gnome slider does not control my screen brightness and neither does my hotkeys. I found an app called 'brightness controller' that can but would really like it to work the good old way that I'm used to, in gnome and with hotkeys

jnicpon commented 3 years ago

For anyone still tracking this issue, my fix is pretty easy for this. Given that an external monitor will trigger the brightness slider, typically as an acpi_video0 linked device (or something else) in /sys/class/backlight, it's generally safe on a desktop to pass acpi_backlight="none" to the kernel on boot on something like a Meerkat (or in my case, a Intel NUC). This will prevent external monitors from being mapped as a backlight. This could be done the usual way if using GRUB, or for Pop_OS! fans with UEFI setups:

sudo kernelstub -a "acpi_backlight=none"

You will need to reboot for the change to take effect, but this will cause your kernel to ignore mapping the backlight on external monitors, which will also cause the gnome 3 menu to not show a slider that doesn't work.

This works well for those of us who want to just use the physical monitor controls to manipulate our displays.