Screen brightness decreases when on battery power (Solved)
Screen brightness decreases when on battery power (Solved)
My vision is not what it used to be.
When I run only on battery power on my laptop, the screen brightness decreases a lot.
Is there a way to stop that ?
When I run only on battery power on my laptop, the screen brightness decreases a lot.
Is there a way to stop that ?
Last edited by scientist on Wed 22 Jul 2015, 22:50, edited 1 time in total.
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
What is the computer make and model?
What version of Puppy?
What version of Puppy?
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
When I was a kid I wanted to be older.... This is not what I expected
YaPI(any iso installer)
Not sure if this works in Slack0
Won't hurt to try it out though. Maybe HP hotkey brightness?
Fn+F7 or Fn+F8? Fn+F10? Not sure because I do not own HP either.
Code: Select all
xbacklight -set 100
Fn+F7 or Fn+F8? Fn+F10? Not sure because I do not own HP either.
You get a gold start with xbacklight.rokytnji wrote:Not sure if this works in Slack0
Code: Select all
xbacklight -set 100
It has to be run after power cable is disconnected.
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Continually Check battery state
I would to create a script that continually checks the status of the battery.
And execute xbacklight if "discharging" is detected.
This is what I have so far.
And execute xbacklight if "discharging" is detected.
This is what I have so far.
Code: Select all
cat /proc/acpi/battery/BAT0/state
Look for discharging and if so then
xbacklight -set 100
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Thanks. Good to know it works in Slack0. After reading myself out of curiosityscientist wrote:You get a gold start with xbacklight.rokytnji wrote:Not sure if this works in Slack0
Code: Select all
xbacklight -set 100
It has to be run after power cable is disconnected.
from$ batwatch -p /run/batwatch.pid -T 30.1 -x /path/to/backlight-script.sh -T 6 -x /path/to/suspend-script.sh
https://github.com/dywisor/batwatch
Just wondering with Slack0's battery monitor applet. If your ideas can be inserted in Slack0's battery applet script.
Just musing here in the desert.
I am not a coder or script writer. Just a tattoed puppy linux using
scooter tramp with a GED education.
The script instagitlet.sh looks promising, but I can not find it.
Code: Select all
https://github.com/dywisor/batwatch
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
It runs all the time.
This is supposed to check if the battery is discharging, but it says
"command not found."
This is supposed to check if the battery is discharging, but it says
"command not found."
Code: Select all
acpi -V | grep -q discharging && xbacklight -set 100 || xbacklight -set 200
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
I know you have marked this solved but I thought I would chuck in my 2cents worth. I have been practicing my novice bash scripting and come up with the following:
This does the opposite of what you asked - it turns the backlight down during battery discharging, but you can easily substitute a different value in the xbacklight line for when $BATTSTATE = discharging and keep the backlight at whatever intensity you want.
The script checks the battery state every 3 seconds so when the laptop power adaptor is turned off you would see your backlight dim for a short period of time. You can change the sleep timeout if you want to change this delay.
Disclaimer:- code may contain traces of peanuts. User discretion advised.
.
Code: Select all
#!/bin/bash
#2015Jul27 Greengeek script to sample battery charge state and perform some
#action depending on state.
#Note: possible states are charged, charging, discharging
number=1
while [ $number = 1 ]; do
BATTSTATE=$(grep charg /proc/acpi/battery/*/state | awk '{print $3}')
if [ "$BATTSTATE" = "charging" ]; then
echo "Battery is charging"
xbacklight -set 100 &
else
if [ "$BATTSTATE" = "discharging" ]; then
echo "Battery is discharging"
xbacklight -set 50 &
else
if [ "$BATTSTATE" = "charged" ]; then
echo "Battery is charged"
xbacklight -set 100 &
fi
fi
fi
sleep 3
done
The script checks the battery state every 3 seconds so when the laptop power adaptor is turned off you would see your backlight dim for a short period of time. You can change the sleep timeout if you want to change this delay.
Disclaimer:- code may contain traces of peanuts. User discretion advised.
.
I went with this modification of your excellent script.
Code: Select all
#!/bin/bash
#2015Jul27 Greengeek script to sample battery charge state and perform some
#action depending on state.
#Note: possible states are charged, charging, discharging
number=1
while [ $number = 1 ]; do
BATTSTATE=$(grep charg /proc/acpi/battery/*/state | awk '{print $3}')
if [ "$BATTSTATE" = "discharging" ]; then
#echo "Battery is discharging"
xbacklight -set 100 &
fi
# check every 10 minutes
sleep 600
done
Thanks,
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar
Andy
Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar