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 Mon 19 Nov 2018, 11:55
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
BatteryBuddy - A program to monitor Battery %
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Author Message
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Fri 24 Aug 2018, 03:20    Post subject:  BatteryBuddy - A program to monitor Battery %
Subject description: gmhBatteryBuddy
 

I am not a programmer, and have always been hesitant to post anything I create. However, this forum has been very helpful to me on several occasions so I am finally going to give something useful (I hope) back to anyone who is interested.

I personally like to use my laptop 'off power' for as long as I can before recharging it. This means I need something which reminds me of the battery charge % and gives me warnings. Of course there are other battery monitoring scrips which people have provided, and I have used some of those. However, none of them quite gave me the functionality I wanted - so I tried to create my own. The result is this application I have called gmhBatteryBuddy

I make it available here for anyone who is interested. It :
- is portable - does not do any installs
- allows user to set up to 4 different warning levels in addition to the 'critical' and 'full' levels
- allows user to set sound and colour of the displayed warnings
- allows user to included in menu and startup via .desktop files.[/list]

Dependencies
The application utilises the following system components which must be present on your system for the application to run:
• acpi : To provide the measurements of power and battery status
• gxmessage : To provide the onscreen messages
• wavplay: To provide the audible sound warnings


Portability
The application has been designed to be portable ie
• it can be unzipped to any location and can be executed from that location
• it does not perform any install process on the host machine
• the only system changes made by the app are:
◦ the creation of a symbolic link /root/.config/autostart to gmhBatteryBuddy_engine (if that option is chosen by the user)
◦ the addition of a desktop file gmhBatteryBuddy.desktop in /usr/share/applications (if that option is chosen by the user)

To begin using –
• unzip the archive package into a folder of your choice
• change the attributes of these four files to make them executable
▪ BatteryBuddyRun.sh
▪ gmhBatteryBuddy.desktop
▪ gmhBatteryBuddy_engine
▪ gmhBatteryBuddy_status.sh
• Edit these 2 files and change the respective lines to reflect the folder/path you have chosen to store this application.
▪ gmhBatteryBuddy.desktop
▪ gmhBatteryBuddy_engine.desktop
• Click on BatteryBuddyRun.sh

I am not a professional programmer, and make no assertion that the code is:
• As efficient as it could be
• Free of logical or syntactical error

The zip archive can be download from my dropbox link here: https://www.dropbox.com/sh/y0re1sgsfsbxvgf/AACDM6_JW1hSpFRQfV4blEZCa?dl=0
Back to top
View user's profile Send private message 
april

Joined: 14 Sep 2013
Posts: 1241
Location: Green Island baby!

PostPosted: Fri 24 Aug 2018, 05:39    Post subject:  

Can you show me whats in the programming scripts first please . Just make a directory on your dropbox with the source in it.
Last edited by april on Sat 25 Aug 2018, 00:49; edited 3 times in total
Back to top
View user's profile Send private message Yahoo Messenger 
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Fri 24 Aug 2018, 05:54    Post subject:  

If you click on the dropbox link it will display the zip file. If you click on the zip file name it will display the contents
All of the source is shown there. It is just bash scripts with gtkdialog. You can view or download any or all files as you wish.
Back to top
View user's profile Send private message 
april

Joined: 14 Sep 2013
Posts: 1241
Location: Green Island baby!

PostPosted: Fri 24 Aug 2018, 06:05    Post subject:  

Deleted
Last edited by april on Sat 25 Aug 2018, 00:48; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger 
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Fri 24 Aug 2018, 06:06    Post subject:  

To allay any fears I have attached the zip file here to this post. I had to remove the PDF help file so that the zip size was small enough to post.

It is just a normal zip created using peazip.

What else can I do.
gmhBatteryBuddy.zip
Description  batterybuddy without the PDF help file
zip

 Download 
Filename  gmhBatteryBuddy.zip 
Filesize  86.53 KB 
Downloaded  24 Time(s) 
Back to top
View user's profile Send private message 
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Fri 24 Aug 2018, 06:16    Post subject:  

gmhBatteryBuddy_engine is one of the scipts contained in the application zip file. It is there.

However - I have also posted a second zip here with just that file so you can view the code.

If there continues to be concerns I will remove this content. I was trying to be helpful not create problems - but truly you can view all of the code for all of the scripts in the zip file. I'm not trying to hide anything.
gmhBatteryBuddy_engine.zip
Description  the script for gmhBatteryBuddy_engine
zip

 Download 
Filename  gmhBatteryBuddy_engine.zip 
Filesize  2.58 KB 
Downloaded  23 Time(s) 
Back to top
View user's profile Send private message 
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Fri 24 Aug 2018, 06:39    Post subject:  

I have now also posted each individual file and each individual folder onto the dropbox location.

You should be able to read all code for all files.

If there is a problem with any of this code I will delete the post - but I cannot see anything strange.
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 996
Location: not Bulgaria

PostPosted: Fri 24 Aug 2018, 07:20    Post subject:  

april wrote:
But what is in "gmhBatteryBuddy_engine"

Where does it come from . There is no source for that


As the author says, it is just a script and the original download is large because it contains a nice usage pdf along with some wav sound files (which inflate its size). I have only had a quick look at the code but looks fine to me.

Nicely produced. I'm on a Dog system and don't have battery on this laptop but I'll give your nice-looking app a try some time. Many thanks.

EDIT: @april: I see no reason geany or mhwaveedit etc should suddenly disappear. The BatterybuddyRun.sh script does contain fixmenus and jwm-reload, but that should only have a negative effect if there was already something wrong with your system (all these commands do is to refresh your jwm menu). You should have downloaded it to its own directory (which is what I always do) since it extracts all the files into the dir you put it. There is no chmod command anywhere in the scripts so I don't see how it could possibly change permissions on your dir. You can prove that to yourself by the way: In the dir where you have extracted the files check for chmod command with:

Code:
grep -r 'chmod' *


wiak
Back to top
View user's profile Send private message 
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Fri 24 Aug 2018, 17:04    Post subject:  

Thanks for that confirmation wiak.

Yes - the script BatteryBuddyRun.sh does contain:

fixmenus : so that the menu entry shows in the menu if the user chooses that option

jwm restart: so that any parameter changes the user makes via the GUI are immediately reflected back in the GUI without having to exit the app and start it again. (may not be the best way to do this, but this is what I came up with)

I also use fixwidgets in the script gmhBatteryBuddy_engine : IF pwidgets is being used this pwidgets restart ensures that the pwidgets battery % shown aligns with the % reported from my app. I found that at critical battery levels the two would sometimes report slightly different % because their 'refresh' cycles are not aligned.
Back to top
View user's profile Send private message 
april

Joined: 14 Sep 2013
Posts: 1241
Location: Green Island baby!

PostPosted: Sat 25 Aug 2018, 00:46    Post subject:  

Yes agreed I was trying to open the engine and it would not . I now see Geany and the others have been lost for the time being so trying to open the engine as text was trying to open it in Open office which just hung . I assumed wrongly that it was a binary not having a ".sh" suffix .

My apologies . I'll fix the above posts.
Back to top
View user's profile Send private message Yahoo Messenger 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13088
Location: Arizona USA

PostPosted: Sat 25 Aug 2018, 09:06    Post subject:  

April, that's about enough of that. You didn't "fix" anything. You made yet another ill-considered accusation and then deleted the post. If you can't do better than that, I'll have to ban you from the forum. Next time something seems to go wrong for you, take a deep breath and keep it to yourself while you try to find out more before jumping to the conclusion that some evil is afoot. And try to keep it civil, will you? And by the way, this is not an attack, it's a warning with an explanation. I hope it suffices.
Back to top
View user's profile Send private message 
Revolverve

Joined: 08 Nov 2008
Posts: 157
Location: 45°17'28.8"N 72°16'08.8"W

PostPosted: Sat 25 Aug 2018, 09:52    Post subject:  

mow9902,
Work great! see both tablet batteries here!!!
post everything you do/did,please!
Very nice gui too.
Back to top
View user's profile Send private message 
Revolverve

Joined: 08 Nov 2008
Posts: 157
Location: 45°17'28.8"N 72°16'08.8"W

PostPosted: Sat 25 Aug 2018, 12:30    Post subject:  

After restart (tahrpup64_JWM v2.3.4) autostart option enabled it did change my jwm theme and tray personal tweaks.I must admit there are still some of jwm management strange to me.
Back to top
View user's profile Send private message 
mow9902

Joined: 26 Nov 2008
Posts: 154

PostPosted: Sat 25 Aug 2018, 17:07    Post subject:  

That's disappointing to hear Revolverve

I have no idea why a jwm restart would have any impact.
I created this app on a tahrpup 6.0.2 system.

Should I pull this app from the forum so that there is no more controversy?
Back to top
View user's profile Send private message 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 13088
Location: Arizona USA

PostPosted: Sat 25 Aug 2018, 17:27    Post subject:  

No, please don't. The only controversy I've seen was caused by april and that was a mistake.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
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.0976s ][ Queries: 12 (0.0153s) ][ GZIP on ]