Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 22 May 2018, 19:56
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
Low-batt notification for Puppy? (Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 3 [40 Posts]   Goto page: Previous 1, 2, 3
Author Message
muggins

Joined: 20 Jan 2006
Posts: 6747
Location: hobart

PostPosted: Thu 08 Feb 2018, 17:07    Post subject:  

I recently changed my pupversion & liked everything except the included powerapplet_tray, which didn'r seem to reflect my laptop's real battery state.

So i'm happy I came across sfs's link for cbatticon, which is easy to compile, accurately reflects battery state, and with which you can have a script in /root/Startup with something like:

Code:
cbatticon -l 10 -r 5 -c wmpoweroff


where it will warn you when percentage gets to 10, then poweroff at 5%.

Last edited by muggins on Sat 10 Feb 2018, 17:35; edited 1 time in total
Back to top
View user's profile Send private message 
festus


Joined: 14 Jan 2015
Posts: 172

PostPosted: Fri 09 Feb 2018, 14:17    Post subject:  

muggins wrote:
I recently changed my pupversion & liked everything except the included powerapplet_tray, which didn'r seem to reflect my laptop's real battery state.

So i'm happy I came across sfs's link for cbatticon, which is easy to compile, accurately reflects battery state, and with which you can have a script in /root/Startup with something like:

Code:
cbatticon -l 10 -r 5 -c wmrpoweroff


where it will warn you when percentage gets to 10, then poweroff at 5%.

Hello, muggins, I am interested in this battery app, but can not compile it, as I have always compiled sources starting with - "./configure --prefix=/usr"
and it did not work with this cbatticon source.

Would you, please, post your comp. recipe for this app.?

btw, I'm using xenial-7.5 & slacko-6999, if that matters any.

Thank you

bliss,
festus
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6747
Location: hobart

PostPosted: Fri 09 Feb 2018, 15:03    Post subject:  

Hello Festus,

I just ran the included makefile & it generated a 31k binary. You can than
just copy the binary to /usr/bin.
Back to top
View user's profile Send private message 
matchpoint

Joined: 26 Jan 2018
Posts: 169

PostPosted: Fri 09 Feb 2018, 16:04    Post subject:  

Hello festus, run the build like this: make WITH_GTK3=0
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6747
Location: hobart

PostPosted: Fri 09 Feb 2018, 17:14    Post subject:  

Thanks Matchpoint,

I forgot you can compile it for gtk3 or gtk2. I just changed line 7, of the makefile, to "WITH_GTK3 = 0".
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6747
Location: hobart

PostPosted: Sat 10 Feb 2018, 05:26    Post subject:  

OK,

here's a pet attached for anyone that wants to try it. I don't know that it will work in every pupversion, but it should in most.

Run
Code:
cbatticon -h
to see usage options. Or open, in a text editor, the script /root/Startup/cbatt and modify it to suit your laptop/preferences. At the moment it has:

Code:
#!/bin/sh

cbatticon -l 5 -r 3 -c wmreboot


So is set to reboot when battery level gets to 3%.
CBattIcon-1.6.7.pet
Description 
pet

 Download 
Filename  CBattIcon-1.6.7.pet 
Filesize  19.1 KB 
Downloaded  30 Time(s) 
Back to top
View user's profile Send private message 
festus


Joined: 14 Jan 2015
Posts: 172

PostPosted: Sat 10 Feb 2018, 12:48    Post subject:  

Thanks for the help, muggins & matchpoint.

I should have realized running "make" would work since it already contained the Makefile.

I am testing it on slacko-6999(32 bit), using "WITH_GTK3 = 1", since I installed gtk3 in this pup.

@muggins
In your initial post about cbatticon, is thie command correct?:
cbatticon -l 10 -r 5 -c wmrpoweroff
the "wmrpoweroff" in particular?
Is the "r" supposed to be there?

Thanks again,
festus
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 10426
Location: Charleston S.C. USA

PostPosted: Sat 10 Feb 2018, 13:34    Post subject:  

I would call that a typo.
Puppy uses
Code:
wmpoweroff

_________________
I have found, in trying to help people, that 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 Shocked
Back to top
View user's profile Send private message 
festus


Joined: 14 Jan 2015
Posts: 172

PostPosted: Sat 10 Feb 2018, 15:33    Post subject:  

bigpup wrote:
I would call that a typo.
Puppy uses
Code:
wmpoweroff

Thanks, bigpup, for the clarification.

I decided to use the gtk-2 vesion on all my pups, and tested it out on slacko-6999 by letting the battery run down past my critical setting of 5%, and it did indeed poweroff the laptop, as desired.

Thanks to all,
festus
Back to top
View user's profile Send private message 
muggins

Joined: 20 Jan 2006
Posts: 6747
Location: hobart

PostPosted: Sat 10 Feb 2018, 17:37    Post subject:  

Yes,

a typo as bigpup said. Corrected initial post. Thanks.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 3 [40 Posts]   Goto page: Previous 1, 2, 3
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0560s ][ Queries: 13 (0.0158s) ][ GZIP on ]