BatteryBuddy - A program to monitor Battery %
BatteryBuddy - A program to monitor Battery %
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/y0re1sgsfsbx ... lEZCa?dl=0
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/y0re1sgsfsbx ... lEZCa?dl=0
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.
It is just a normal zip created using peazip.
What else can I do.
- Attachments
-
- gmhBatteryBuddy.zip
- batterybuddy without the PDF help file
- (86.53 KiB) Downloaded 78 times
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.
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.
- Attachments
-
- gmhBatteryBuddy_engine.zip
- the script for gmhBatteryBuddy_engine
- (2.58 KiB) Downloaded 77 times
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.april wrote:But what is in "gmhBatteryBuddy_engine"
Where does it come from . There is no source for that
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: Select all
grep -r 'chmod' *
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.
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.
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.
My apologies . I'll fix the above posts.
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.
- Revolverve
- Posts: 255
- Joined: Sat 08 Nov 2008, 21:01
- Location: 45°17'28.8"N 72°16'08.8"W_avatar/ mira.ca
- Revolverve
- Posts: 255
- Joined: Sat 08 Nov 2008, 21:01
- Location: 45°17'28.8"N 72°16'08.8"W_avatar/ mira.ca
Be my guest ..Get Fucked PrickFlash wrote: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.
The forum is dead anyway. Its stuck in a rut and
Barry fell down it and is flailing around at the bottom ..you should join him.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
@ mow9902:-
This looks quite interesting, and it follows my own 'modus operandi'; that of providing choice in all things. The more choices Puppians have, the better.
Don't allow the somewhat erratic behaviour of certain Forum members to deter you from developing more stuff like this. They're usually the author of their own problems.....
And no need to be apologetic about it. You've got nowt to apologise for. Well done.
Mike.
No, no, no; don't do that.mow9902 wrote:Should I pull this app from the forum so that there is no more controversy?
This looks quite interesting, and it follows my own 'modus operandi'; that of providing choice in all things. The more choices Puppians have, the better.
Don't allow the somewhat erratic behaviour of certain Forum members to deter you from developing more stuff like this. They're usually the author of their own problems.....
And no need to be apologetic about it. You've got nowt to apologise for. Well done.
Mike.
- Revolverve
- Posts: 255
- Joined: Sat 08 Nov 2008, 21:01
- Location: 45°17'28.8"N 72°16'08.8"W_avatar/ mira.ca
mow9902
Removed? of course no!
Worst case,change revision from 1.0 to 0.? or the next to 1.1...
controversy? forget that...gone
To me it's just learning a little bit more ..now jwm and users...
There are plenty of users around to help with any glitches .
Looking at scripts,i dont find what lead to your jwm default theme.
Removed? of course no!
Worst case,change revision from 1.0 to 0.? or the next to 1.1...
controversy? forget that...gone
To me it's just learning a little bit more ..now jwm and users...
There are plenty of users around to help with any glitches .
Looking at scripts,i dont find what lead to your jwm default theme.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
@ mow9902:-
Just d/l'ed, extracted, and 'set things up', to have a 'look-see'. (This is on my Compaq desktop, so, obviously, no battery to check, yet). I'll be trying this out on the old Dell lappie before too long, so I'll give you a progress report as & when I do.
First impressions? Nice. Very professionally done.
I like it. Once again, well done. Keep it up, mate!
Mike.
Just d/l'ed, extracted, and 'set things up', to have a 'look-see'. (This is on my Compaq desktop, so, obviously, no battery to check, yet). I'll be trying this out on the old Dell lappie before too long, so I'll give you a progress report as & when I do.
First impressions? Nice. Very professionally done.
I like it. Once again, well done. Keep it up, mate!
Mike.
Bringing up problems, suggestions, questions, and having to make code changes, is all part of offering software to Puppy.Should I pull this app from the forum so that there is no more controversy?
I have never, I repeat never, seen a piece of offered software be 100%, at first offering.
Take it all in and if you want to make changes, please do!
If you do not, that is up to you as the developer of the software.
99.9% of us just want to make this a better piece of software.
If you ever think something is 100%, before it gets used in the real world, not going to happen!!!
Last program I worked on, for Puppy, took about 6 months of testing, tweaking, improvements, testing, several releases, etc...... before getting to final release.
Just got told about a problem that never showed up in testing, but did in real world use.
Final release had been out for about 2 years.
Time for code tweaking and the person that found the problem, offered the code change to fix it.
That is Puppy software
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)