Skip to main content
Topic: XFCE4 Screen Brightness (Read 2503 times) previous topic - next topic
0 Members and 6 Guests are viewing this topic.

XFCE4 Screen Brightness

Hello everyone, I hope I am posting this question in the right area. I installed XFCE4 on my laptop that I installed artix-runit with cinnamon desktop already installed. My problem is, I can't get the brightness to be remembered across reboots. On Manjaro for example, the brightness will be remembered once I reboot. Is there anything I can do to fix this? I am really loving this distro.

Re: XFCE4 Screen Brightness

Reply #1
Code: [Select]
pacman -S backlight-openrc
this help not? i use it for restore the screen brightness at system startup

 

Re: XFCE4 Screen Brightness

Reply #2
for runit we prepare a package too.

Re: XFCE4 Screen Brightness

Reply #3
On my laptop using XFCE4 there are 2 places I need to set my screen brightness - in the BIOS menus, and in the desktop settings. Go to Applications - Settings - Power Manager - Display tab. Then make the settings you want. Perhaps you've done that already though.

Re: XFCE4 Screen Brightness

Reply #4
On my laptop using XFCE4 there are 2 places I need to set my screen brightness - in the BIOS menus, and in the desktop settings. Go to Applications - Settings - Power Manager - Display tab. Then make the settings you want. Perhaps you've done that already though.
that not help, because after restart, as he wrote, is the setting not restored. for this need really a backlight package

EDIT: i has same problem with my toshiba laptop.  solution was only backlight(-openrc) package.

Re: XFCE4 Screen Brightness

Reply #5
Is backlight-openrc really the best way to handle this? The script directly modifies files in /var/cache/backlight which of course works, but I would think there's a generic program that sets brightness that you can add as a oneshot in a startup script.

Re: XFCE4 Screen Brightness

Reply #6
I have a Dell laptop and don't have that  installed, the settings are saved in .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml and it works fine. But I can change the value manually in /sys/class/backlight/*/brightness like backlight-openrc does too, after looking at it to see what it does, so I'm sure that would work as well, it's probably different for various hardware. The only "backlight" package I have installed is xorg-xbacklight.

Re: XFCE4 Screen Brightness

Reply #7
I have a Dell laptop and don't have that  installed, the settings are saved in .config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml and it works fine. But I can change the value manually in /sys/class/backlight/*/brightness like backlight-openrc does too, after looking at it to see what it does, so I'm sure that would work as well, it's probably different for various hardware. The only "backlight" package I have installed is xorg-xbacklight.

Good point. I think /sys/class/backlight/ should be generic for all hardware. The /var/cache/backlight one probably doesn't exist everywhere. It's probably worth patching the script to change the paths at the very least.

Re: XFCE4 Screen Brightness

Reply #8
My understanding from looking at the script was it stores the value in /var/cache, but sets it by copying the saved file to /sys/class/backlight/*/brightness (which you can manually echo values to as root, although there is a max_brightness file in the dir you should probably look at first) whereas XFCE saves the value in xfce4-power-manager.xml and I'm not sure exactly how or where it sets it, so if it wasn't working on some hardware it could be an XFCE bug, or perhaps some optional dependency package was missing.
Code: [Select]
start() {
    ebegin 'Restoring the screen brightness'
   
for card in `find /sys/class/backlight/ -type l`; do
        if [[ -r "/var/cache/backlight/`basename $card`-brightness-old" ]]; then
            cp "/var/cache/backlight/`basename $card`-brightness-old" "/sys/class/backlight/`basename $card`/brightness"
        fi
    done

    eend $?
}

stop() {
    ebegin 'Saving the screen brightness'
    if ! [[ -d '/var/cache/backlight/' ]]; then
        mkdir '/var/cache/backlight'
    fi
    if ! [[ -w '/var/cache/backlight/' ]]; then
        chmod 755 '/var/cache/backlight/'
    fi
   
for card in `find /sys/class/backlight/ -type l`; do
        cp "/sys/class/backlight/`basename $card`/brightness" "/var/cache/backlight/`basename $card`-brightness-old"
    done
    eend $?
}

Re: XFCE4 Screen Brightness

Reply #9
Oh yes, you're right. I just can't read.

Re: XFCE4 Screen Brightness

Reply #10
for runit we prepare a package too.
Sorry, I am not here often. I run runit. I just tried to install it, but I don't see it in the repos when I run "sudo pacman -Ss backlight-runit" I see the openrc version of the package.

Re: XFCE4 Screen Brightness

Reply #11
It has not been done yet. Looking it up, I realized that systemd actually comes with a specific service for this, so yeah I'll add a note on our todo list to make a backlight-runit and backlight-s6 package.

Re: XFCE4 Screen Brightness

Reply #12
It has not been done yet. Looking it up, I realized that systemd actually comes with a specific service for this, so yeah I'll add a note on our todo list to make a backlight-runit and backlight-s6 package.
That's awesome. I can't wait. For now, is there anything you recommend for me to try until that is made? It's not a big deal, it's just kinda annoying.

Re: XFCE4 Screen Brightness

Reply #13
I guess you could try using xorg-xbacklight and then running a command on startup to set the brightness. I believe the file for startup commands is either "/etc/runit/rc.local" or "/etc/rc.local". I don't remember which one.