LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy
User Name
Password
Puppy This forum is for the discussion of Puppy Linux.

Notices


Reply
  Search this Thread
Old 07-16-2015, 10:46 PM   #1
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Rep: Reputation: 169Reputation: 169
Stop screen brightness from decreasing when running on battery


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 ?
 
Old 07-17-2015, 03:08 AM   #2
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
I dont't know PuppyLinux but from a general point of view, I'd say that you'll have to look at ACPI management on the computer.
 
Old 07-17-2015, 04:17 PM   #3
darry1966
Member
 
Registered: Sep 2011
Location: Christchurch NZ
Distribution: Debian, DebianDog
Posts: 125

Rep: Reputation: 35
I found this http://murga-linux.com/puppy/viewtopic.php?t=87873
 
Old 07-19-2015, 06:00 PM   #4
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
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.

Quote:
cat /proc/acpi/battery/BAT0/state

Look for discharging and if so then

xbacklight -set 100
I am studying grep as I think it will be used as well. :-)

Last edited by Fixit7; 07-19-2015 at 08:36 PM.
 
Old 07-21-2015, 02:34 AM   #5
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Can be done in one line in a Cron task :-)
 
Old 07-21-2015, 02:54 PM   #6
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
* * * * * xbacklight -set 100 #Bright_Always_On
 
Old 07-23-2015, 02:30 AM   #7
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Here you're just executing the same setting over and over. You have to put the "discharging" test before the xbacklight, and set another line to light it up again if the battery is charging... Personal note: this wouldn't work with mine, wich displays that battery is discharging even when on AC, so if I would want to do what you're doing, I should test the AC presence instead of the battery state.
 
Old 07-23-2015, 09:04 AM   #8
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
I can figure out how to do the discharging test.
 
Old 07-23-2015, 09:28 AM   #9
Stéphane Ascoët
Member
 
Registered: Feb 2004
Location: Fleury-les-Aubrais, 120 km south of Paris
Distribution: Devuan, Debian, Mandrake, Freeduc (the one I used to work on), Slackware, MacOS X
Posts: 251

Rep: Reputation: 49
Something like "acpi -V | grep -q discharging && xbacklight -set 100 || xbacklight -set 200"
You'll have to read manuals and test commands on the command line
 
Old 07-23-2015, 06:02 PM   #10
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
It gave "command not found."
 
Old 07-26-2015, 03:44 PM   #11
Fixit7
Senior Member
 
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374

Original Poster
Rep: Reputation: 169Reputation: 169
Another way.

Quote:
#!/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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mint 15 = black screen (brightness = 0) on start up - have to manually set brightness Netnovice Linux Mint 4 01-16-2014 08:46 PM
How to Stop battery charging manually? marco18 Linux - Laptop and Netbook 9 11-16-2010 09:56 PM
Laptop Screen Flicks (with horizontal lines) When running on Battery Power bishnubpm Linux - Laptop and Netbook 2 10-05-2010 05:12 AM
Battery doesn't keep charge after running BIOS Battery Discharge/Charge Utility dan.leonard Linux - Laptop and Netbook 0 09-28-2004 01:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Puppy

All times are GMT -5. The time now is 04:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration