Hi, all.
I've wasted several hours today trying to get my Acer E11 set to reduce display brightness when moving from A/C to battery power. I've searched for a solution in every way I can think of, but I can not find an answer to this. Here's my system:
OS: MX x86_64
Host: Aspire ES1-111M V1.16
Kernel: 5.10.0-8mx-amd64
Shell: bash 5.0.16
Resolution: 1366x768
DE: Xfce 4.14
WM: Xfwm4
WM Theme: Arc-Dark
Theme: Greybird-mx [GTK2], Arc-Darker [GTK3]
Icons: Papirus [GTK2], Moka [GTK3]
Terminal: xfce4-terminal
Terminal Font: Monospace 11
CPU: Intel Celeron N2840 (2) @ 2.582GHz
GPU: Intel Atom Processor Z36xxx/Z37xxx Series Graphics & Display
Memory: 2094MiB / 7843MiB
I'm using TLP for power tuning, and it's doing a really good job as I have it set. The laptop came with Windows 7, upgraded to Win10, and I was never able to get more than about 4 hours of battery time out of it. Now I can get 5.5 with no trouble at all, but I'd like to see what screen dimming might add to that. Yes, of course I can do it manually, and I may end up having to do that, but why in the world is it so difficult to have it set automatically?
If anyone can recommend a hidden setting or a little app to do it I'd appreciate it greatly.
Thanks for reading,
KB
About display auto dimming on battery... [Solved]
- K_B_Tidwell
- Posts: 13
- Joined: Thu Sep 02, 2021 9:25 am
-
- Developer
- Posts: 372
- Joined: Mon Apr 16, 2012 4:51 pm
Re: About display auto dimming on battery...
Not entirely sure if there is a better "MX" way of dimming the display. I have been using a udev rule and xbacklight to do this. The udev rule runs a script on power cable connect / disconnect. The script also runs aplay to play a disconnect and connect sound.
The udev rules are:
Edit:
If xbacklight does not work there are other alternatives that may work (or may work better anyway). In most cases there is also the option to run an echo "value" > /sys/path/to/display/brightness in the script instead
The udev rules are:
Code: Select all
# Name: 61-on-power.rules
# Rule for when switching to powersupply
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="1",RUN+=" /bin/bash '/usr/local/bin/power-plug charging' "
Code: Select all
# Name: 61-on-battery.rules
# Rule for when switching to battery
SUBSYSTEM=="power_supply",ENV{POWER_SUPPLY_ONLINE}=="0",RUN+=" /bin/bash '/usr/local/bin/power-plug discharging' "
Code: Select all
#!/bin/bash
#Name power-plug
#Script run by udev rule when power cable is connected or disconnected.
case $1 in
charging)
play /usr/share/sounds/freedesktop/stereo/power-plug.oga &
xbacklight -s 80;
;;
discharging)
play /usr/share/sounds/freedesktop/stereo/power-unplug.oga
xbacklight -s 20;
;;
esac
If xbacklight does not work there are other alternatives that may work (or may work better anyway). In most cases there is also the option to run an echo "value" > /sys/path/to/display/brightness in the script instead
Re: About display auto dimming on battery... [Solved]
i don't use xfce so i can't check but can't this be done under power manager -display settings?
KDE has the option to dim screen immediately on battery ... i thought xfce would have a similar setting
edit ... antix-dave responded while i was typing so seems i assumed wrong
KDE has the option to dim screen immediately on battery ... i thought xfce would have a similar setting
edit ... antix-dave responded while i was typing so seems i assumed wrong
- K_B_Tidwell
- Posts: 13
- Joined: Thu Sep 02, 2021 9:25 am
Re: About display auto dimming on battery...
After exploring the use of udev, I'm going to give this method a shot. I appreciate your direction and the hint about the echo "value". Pending a moment when I have some time to try this, I'll preemptively mark this "solved".antiX-Dave wrote: ↑Mon Sep 06, 2021 10:25 pm Not entirely sure if there is a better "MX" way of dimming the display. I have been using a udev rule and xbacklight to do this. The udev rule runs a script on power cable connect / disconnect. The script also runs aplay to play a disconnect and connect sound.
Edit:
If xbacklight does not work there are other alternatives that may work (or may work better anyway). In most cases there is also the option to run an echo "value" > /sys/path/to/display/brightness in the script instead
Thank you for your help!
KB
K B
- K_B_Tidwell
- Posts: 13
- Joined: Thu Sep 02, 2021 9:25 am
Re: About display auto dimming on battery...
XFCE seems to be short several bells and whistles, but I would have thought that screen dimming on disconnection from A/C would be baked in to every distro. I'd run a more fleshed out desktop but my hardware is a little too horsepower-limited for comfort. I do thank you for your response!junoluna wrote: ↑Mon Sep 06, 2021 10:32 pm i don't use xfce so i can't check but can't this be done under power manager -display settings?
KDE has the option to dim screen immediately on battery ... i thought xfce would have a similar setting
edit ... antix-dave responded while i was typing so seems i assumed wrong
KB
K B
-
- Developer
- Posts: 372
- Joined: Mon Apr 16, 2012 4:51 pm
Re: About display auto dimming on battery...
There is an option in the xfce power manager settings for on battery vs on charge.
I had forgot about that option as it does not work on my new computer however YMMV. (Plus I like having the disconnect and reconnect sound :D )
I had forgot about that option as it does not work on my new computer however YMMV. (Plus I like having the disconnect and reconnect sound :D )
- K_B_Tidwell
- Posts: 13
- Joined: Thu Sep 02, 2021 9:25 am
Re: About display auto dimming on battery...
Well...I think I do recall that setting, and I recall the function working (or at least I think I remember that...hopped several distros in the last couple months). But that leads me to another question I've not really found an answer to (though I admit I haven't been super focused on finding the answer). Will the XFCE power manager run concurrently with TLP? My limited understanding of the situation says that TLP takes over if it's activated and other managers won't run at the same time. Because of that, I disabled the XFCE power manager in startup.antiX-Dave wrote: ↑Tue Sep 07, 2021 9:53 am There is an option in the xfce power manager settings for on battery vs on charge.
I had forgot about that option as it does not work on my new computer however YMMV. (Plus I like having the disconnect and reconnect sound :D )
If it will really run alongside TLP, I'll re-enable it for the brightness control. I just didn't want anything taking precedence over TLP because it's really doing a great job extending my battery, so I played it safe.
K B