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 Fri 25 May 2018, 13:08
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 2 of 3 [40 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
B.K. Johnson

Joined: 12 Oct 2009
Posts: 651

PostPosted: Mon 11 Jan 2016, 02:18    Post subject:    

Mike Walsh wrote:
Quote:
...Bill does things this way with a lot of the .pets that he creates, because it usually means that folk who do request an item are more likely to be serious about testing it out, and reporting back with results!

It's not the puppy forum way. Confused Rolling Eyes

With apologies to the iconic quote from W.P. Kinsella's Field of Dreams: "If you build it, he will come."
Bill, "If you build it, they will come." "If you expose it, they will hear of it[find it]; don't and it stays hidden." Smile

Quote:
Hope that helps. Just drop him a request by PM if you'd like to try it out. That's usually all it takes. Be patient; it may take him a little while to get back to you.

Sure clears the air. Thanks Mike. Had you not made reference to batterup, nobody would have heard of it. It seems you were invited via PM to try it. Perhaps protocol would dictate that your test reports should have also been made in private. Naughty Mike! Razz (kidding of course) As my lappy isn't working at the moment, no PM to Bill. I would not want to upset him by taking too long to report results. I'll just make a note in my archives that batterup is available on request. Wink

_________________
B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM

Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 3702
Location: King's Lynn, UK.

PostPosted: Mon 11 Jan 2016, 20:56    Post subject:  

Hi again, BK.

B.K.Johnson wrote:
It's not the puppy forum way. Confused Rolling Eyes

With apologies to the iconic quote from W.P. Kinsella's Field of Dreams: "If you build it, he will come."
Bill, "If you build it, they will come." "If you expose it, they will hear of it[find it]; don't and it stays hidden." Smile


Well, I wouldn't exactly say it's hidden.....after all, there is a thread about it in plain sight on the forum:-

http://www.murga-linux.com/puppy/viewtopic.php?t=91019

.....and it's in the 'Utilities' section, right where you'd expect to find it. He's not hiding the fact that it exists; just being selective about who gets to test it, that's all. Makes sense to pick folks who are more likely to report back, I would have thought. But that's just me.

Some people just have their eccentricities; that's the way Bill prefers to do it.....seems to work well enough. He has made a lot of very useful contributions to the Forums, there's no denying that. I, myself, am using at least 7 of his pets that I can think of off the top of my head; all small, but very useful 'utilities' of various sorts.....that have made Puppy even more usable, if that's possible..!


Mike. Wink

_________________
MY PUPPY PACKAGES | 'Thanks' are always appreciated!
--------------------------------------

Back to top
View user's profile Send private message Visit poster's website 
corvus


Joined: 12 Jun 2015
Posts: 127
Location: In the peninsula shaped like a boot.

PostPosted: Fri 22 Jan 2016, 11:37    Post subject:  xbat and acpitool  

G'day gjuhasz, I tried your xbat-p.pet on an ASUS X555L laptop with Xanad's T64_Light-k_4.1.3 EmSee_x86-64 an Italian version derived from 666philb's Tahrpup64, It works very well, great job, Bravo. Very Happy
The only drawback is that the icon of powerapplet in the tray remains the default (same with xbat.pet).
I have a request it's possible to modify xbat so as to suspend the laptop with acpitool's -s option when it reaches to a particular discharge percentage and to include this option in the xbatalarm-config?

Regards. Smile

corvus

_________________
Hoc unum scio, me nihil scire. Socrate
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 4208
Location: Kiel,Germany

PostPosted: Mon 25 Jan 2016, 06:02    Post subject:  

Here is a modified version that tries to care for battery and emit a xmessage GUI
of /sbin/pup_event_frontend_d .

It is still the old script style, not the current binary exe.

I attach it to give you an idea .
If you want to install it, you may get problems even if set executable .
You can test it by pup_event_frontend_d restart option .

In the editor search for lines containing "BAT_0_CURRENT" .

The idea occured to me to check for battery inside pup_event_frontend_d, since it also
checks for the POWERTIMEOUT variable set in /etc/eventmanager .
If pup_event_frontend_d checks for mousecounts, it could also check for battery status .
pup_event_frontend_d.gz
Description  heavily modified
gz

 Download 
Filename  pup_event_frontend_d.gz 
Filesize  13.81 KB 
Downloaded  71 Time(s) 

_________________
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal Razz
Back to top
View user's profile Send private message 
gjuhasz


Joined: 29 Sep 2008
Posts: 362

PostPosted: Tue 26 Jan 2016, 21:10    Post subject: Re: xbat and acpitool  

corvus wrote:
The icon of powerapplet in the tray remains the default (same with xbat.pet). I have a request it's possible to modify xbat so as to suspend the laptop with acpitool's -s option when it reaches to a particular discharge percentage and to include this option in the xbatalarm-config?


Dear corvus,

Hm... I created xbat.pet to force tray icon based visualization - but tested with 32-bit puplets only on Dell and HP laptops. The icon changes according to the (dis)charging level going thru all statuses (see icons at /usr/share/pixmaps/puppy).
Please give me some time to check with a 64-bit puplet (possibly slacko64). Also, I will play with acpitool -s option, first in 32-bit version.

Have fun!

Regards,

gjuhasz
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1515
Location: Japan

PostPosted: Wed 27 Jan 2016, 03:21    Post subject: Re: Xbatalarm combined with powerapplet_tray  

gjuhasz wrote:
For those cannot get powerapplet_tray working, I referenced it in xbatalarm.
Among other changes, I applied new icons and forced the right one to appear in the tray
What exactly is the difference between the original powerapplet_tray and the one you packed into the pet?

The original icons were quite ugly, but your binary appears to contain no icons at all. After starting the binary it runs in the tray, but the spot remains blank. I see that the accompanying script xbatalarm links to the binary and that they work together, but if I understand the script correctly it kills and restarts the binary every 30sec. which I find a bit rough. I would prefer to use a nicer looking, stand-alone powerapplet_tray. Are you planning to add icons?
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 127
Location: In the peninsula shaped like a boot.

PostPosted: Wed 27 Jan 2016, 09:05    Post subject:  

Evening, all.
And thank you for your interest to my request.
I thought of something simple like:
Quote:

SUSP_MARK=$(echo "$LAST_F_CHRG * $SUSP_PERC / 100" | bc) # with $SUSP_PERC entry in xbatalarm.conf

if (( $(bc <<< "$REAL_CHRG < $SUSP_MARK") )); then
acpitool -s &
fi


to be included somewhere in xbatalarm and its entry to xbatalarm.conf
thanks again. Smile

corvus

_________________
Hoc unum scio, me nihil scire. Socrate
Back to top
View user's profile Send private message 
gjuhasz


Joined: 29 Sep 2008
Posts: 362

PostPosted: Wed 27 Jan 2016, 12:29    Post subject: Re: Xbatalarm combined with powerapplet_tray  

MochiMoppel wrote:
What exactly is the difference between the original powerapplet_tray and the one you packed into the pet?
...
After starting the binary it runs in the tray, but the spot remains blank

Oops... I found an earlier, buggy version at the link I advertised. Embarassed The correct version is uploaded as www.smokey01.com/gjuhasz/packages/xbat.pet
Now, the battery status is visualized by the tray icon and the warning message pops up repeatedly when 10% or less capacity remained.
After installed, you can activate it either by clicking on the xbatalarm menu item or by restarting X. Next time it will auto-start.
Sorry for the inconvenience.

Quote:
The original icons were quite ugly, but your binary appears to contain no icons at all. ... Are you planning to add icons?

The redesigned icons are in /usr/share/pixmaps/puppy folder.

Quote:
I see that the accompanying script xbatalarm links to the binary and that they work together, but if I understand the script correctly it kills and restarts the binary every 30sec. which I find a bit rough. I would prefer to use a nicer looking, stand-alone powerapplet_tray.

You are right. But it is intentional. I recognized that the binary powerapplet_tray fails to point dynamically to the right icon (so it is unable to mirror the actual battery status) but did not modify it. Instead, I only regularly provide the binary with the right picture behind the fixed blank.svg filename Shocked
Just one note: I only check the status instead of restarting the binary in every 30 sec... restarting happens only if a new picture shall be displayed. Wink

Have fun!

Regards,

gjuhasz
Newicons.jpg
 Description   
 Filesize   19.85 KB
 Viewed   345 Time(s)

Newicons.jpg

Back to top
View user's profile Send private message 
gjuhasz


Joined: 29 Sep 2008
Posts: 362

PostPosted: Wed 27 Jan 2016, 13:58    Post subject: Re: xbat and acpitool  

gjuhasz wrote:
Please give me some time to check with a 64-bit puplet (possibly slacko64).


Well,

the powerapplet_tray binary fails to work in Slacko 64 either, but performs it differently. Wink

I plan to fix it as soon as I have time. However, for enthusiasts who want to see a dynamically changing powerapplet_tray icon in Slacko64, here is the list of steps (after installed my xbat.pet which works fine for 32-bit puplets such as Tahr 6.0.5):
    1. Remove /usr/bin/powerapplet_tray installed with my my xbat.pet and restore the original one from /initrd/pup_ro2/usr/bin
    2. Move my new icons from /usr/share/pixmaps/puppy to /usr/share/powerapplet
    3. Temporarily, change the theme in Slacko64 to any other one
    4. Restart X
    5. Set up the previous theme
Smile

Have fun!

Regards,

gjuhasz
Back to top
View user's profile Send private message 
sfs

Joined: 02 Nov 2013
Posts: 41
Location: Russia

PostPosted: Thu 28 Jan 2016, 03:26    Post subject: Re: xbat and acpitool  

https://github.com/valr/cbatticon
_________________
PuppyRus-Arch
Back to top
View user's profile Send private message Visit poster's website 
gjuhasz


Joined: 29 Sep 2008
Posts: 362

PostPosted: Thu 28 Jan 2016, 08:26    Post subject: Re: xbat and acpitool  

corvus wrote:
I have a request it's possible to modify xbat so as to suspend the laptop with acpitool's -s option when it reaches to a particular discharge percentage and to include this option in the xbatalarm-config?


Please find my first attempt to suspend the machine at http://smokey01.com/gjuhasz/packages/xbat-s.pet

Please notice that this is for test purposes that suspends the machine just a couple of minutes after the low-batt warning.

Please take a look at Lines 15-16 in /usr/bin/xbatalarm script:
Code:
ALRM_MARK=$(echo "$LAST_F_CHRG * $ALRM_PERC  / 100" | bc)
SUSP_MARK=$(echo "$LAST_F_CHRG * $ALRM_PERC  / 101" | bc)

The production version will allow more gap between the first alarm and the hibernation:
Code:
ALRM_MARK=$(echo "$LAST_F_CHRG * $ALRM_PERC  / 100" | bc)
SUSP_MARK=$(echo "$LAST_F_CHRG * $ALRM_PERC  / 150" | bc)

Proposed test case:
    1. Install xbat-s.pet. Ensure that the charger is disconnected and no USB sticks remain mounted.
    2. In a terminal, issue acpi to see the actual battery percentage.
    3. From the System menu, run xbatalarm-config and set the actual acpi battery percentage Exclamation as alarm level.
    4. Check the alerts displayed (in each 30 seconds about low batt level)
    5. Wait some minutes until the hibernation alert arrives. The machine is hibernated in 10 seconds, the (machine-specific) LED slowly blinks.
    6. Connect the charger.
    7. To wake up the machine, shortly press the power button (in most cases, this contains the slowly blinking LED). The machine should wake up then show the previously seen graphical content of X in a few seconds.

Known issues that lead to inaccessible/crashed items in X after wake up:
    1. If you do not connect the charger while the machine is hibernated, it will be hibernated again, just after you wake the machine up.
    2. If hibernation happens during high CPU/memory usage, the machine may not wake up (needs to be rebooted by long pressing the power button).
    3. If there is a write process to the pendrive, data can be lost or even its filesystem can be damaged.

I would appreciate to receive any feedback.
Also, I am interested in your opinion about the best hibernation risk policy. That is, forcing some pre-emptive commands that admit some smaller issues to avoid the bigger problems. For example, force unmount of all devices, exit running programs, exit to prompt (closing X), etc., may cause loss of the latest session's data but prevents data loss in the "innocent" filesystem(s).

Thanks in advance

Have fun!

Regards,

gjuhasz
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 127
Location: In the peninsula shaped like a boot.

PostPosted: Fri 29 Jan 2016, 05:18    Post subject:    

Hi gjuhasz, I tested xbat-s, now the powerapplet icons are displayed correctly. I followed your instructions step by step, with my frugal installation booted via USB pendrive, but when xbat has tried to suspend the system it has restarted X.
After several tests I realized that your acpitool binary has a wrong ELFCLASS (it's not 64 bit) so I replaced it with the right one, downloaded from PPM, and it worked. Very Happy
I need more time to test it better. I thank you for the time and effort in improving this tool. Smile

Regards,

corvus

_________________
Hoc unum scio, me nihil scire. Socrate
Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1515
Location: Japan

PostPosted: Fri 29 Jan 2016, 08:39    Post subject: Re: Xbatalarm combined with powerapplet_tray  

gjuhasz wrote:
Just one note: I only check the status instead of restarting the binary in every 30 sec... restarting happens only if a new picture shall be displayed. Wink

I'm afraid not Wink
This happens every 30sec when AC is plugged in and battery is fully charged (code line 41), i.e. even during a time when no new icon needs to be displayed:.
Code:
cp /usr/share/pixmaps/puppy/charged.svg /usr/share/pixmaps/puppy/blank.svg
sync
killall -9 powerapplet_tray; sync ;powerapplet_tray &

That's a lot of copying and killing and resurrenction. Laughing
Back to top
View user's profile Send private message 
gjuhasz


Joined: 29 Sep 2008
Posts: 362

PostPosted: Fri 29 Jan 2016, 22:06    Post subject: Re: Xbatalarm combined with powerapplet_tray  

MochiMoppel wrote:
That's a lot of copying and killing and resurrenction. Laughing


Fixed. Dear MochiMoppel, thanks for the notification.

I uploaded three xbat flavors to www.smokey01.com/gjuhasz/packages
    1. xbat.pet - 32-bit tray binary included
    2. xbat-p.pet - for Puli users. No tray binary (thus hopefully compatible with 64-bit Slacko, too)
    3. xbat-s.pet - my 2nd attempt to correctly suspend the machine. Same as xbat-p above, with additional suspend feature.
    No tray binary either. Works without acpitool on the laptops I have access to.
    Known issue: If a USB stick remained plugged in (even if unmounted), some laptops rise from sleep after 2-3 seconds.

Dear corvus - could you please check the new xbat-s? Here, with reference to my above post, I apply a realistic preset
Code:
SUSP_MARK=$(echo "$LAST_F_CHRG * $ALRM_PERC  / 150" | bc)
    where it is better to temporarily change the value from 150 to 101 for testing purposes. Also, in the updated /usr/bin/suspend script, I commented out the acpitool call in favor of the simpler method in the next line - you can switch back if necessary.
    I understand that adding a $SUSP_PERC entry to xbatalarm.conf is more elegant but some additional hint or constraint
    (e.g., 5 < $SUSP_PERC < $ALRM_PERC ) shall be applied in this case to help novice users.

Have fun!

Regards,

gjuhasz
Back to top
View user's profile Send private message 
corvus


Joined: 12 Jun 2015
Posts: 127
Location: In the peninsula shaped like a boot.

PostPosted: Sat 30 Jan 2016, 14:21    Post subject:  

Hi gjuhasz, I did several tests with xbat-s.pet, works fine but on one occasion at wake up the system crashed with the following error:
Quote:
puppypc1672 login: [drm: gen8_irq_handler [i915]] * ERROR * the master control interrupt lied (SDE)

and I made a forced restart to fix the system. Confused

Code:
SUSP_MARK=$(echo "$LAST_F_CHRG * $ALRM_PERC  / 150" | bc)


With the above settings and default xbatalarm-config my system went into suspension around the 5%.
The new string, for suspension, did not affect the overall functions I still enjoyed the choice of using acpitool.
Great work, thanks. Smile Smile

corvus

_________________
Hoc unum scio, me nihil scire. Socrate
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 3 [40 Posts]   Goto page: Previous 1, 2, 3 Next
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.0780s ][ Queries: 12 (0.0145s) ][ GZIP on ]