maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   [Announce] Battery Percentage 'widget' for Nokia N9 - V0.1.5 (https://talk.maemo.org/showthread.php?t=82526)

MFaroTusino 2012-02-23 07:03

[Announce] Battery Percentage 'widget' for Nokia N9 - V0.1.5
 
1 Attachment(s)
Development of this app has ceased as my goal has been fulfilled. Percentage has been successfully replaced and is available in Unrestricted-System-UI.

I want to say a huge thanks to everyone who supported the app. I suggest you follow any posts regarding USI, and support MAG's efforts.

Also, SPECIAL THANKS to crazyhg for being the one to finally complete what I started. My only regret is not learning QT quick enough to be able to do it myself.


You may have seen my post a while back about trying to replace the N9's battery icon for a percentage. Well I am half way there. At the moment, I am announcing an app Icon widget.

http://i.imgur.com/vywEs.png

This "widget" builds upon THP's IpAddr widget, and a lot of thanks goes to him for his support during the development of my app. I would also like to thank Ejas Mudar (MrModr), Schturman, and NovaG for their help along the way. Also, immi.shk for his icon design for what I've implemented as the charging icon :)

What does it do?
It is simple. Launching the app results in the execution of shell and python script in which the icon of the app is populated with the current percentage. IF the device is in a charging state, this will also be shown.

The percentage is gathered the same way that it does in the Settings>Device>Battery menu, so it is as accurate as it can be (I assume anyway).

There is a lot of work to still be done. All development done on an N950 itself.

APP REQUIRES DEVELOPER MODE TO BE ENABLED

Current Install Method:
If you have V0.0.4 or earlier, remove first and then install v0.1.1 or later. If you have V0.1.1 or later, you can simply install over previous version

Install the latest version
If install doesn't download python and python imaging, do it via xterm (apt-get install python python-imaging)

To Do list:
-Centre "Chrg" Text
-Auto update of percentage (No need to tap icon) [If you know how to create the daemon for a script, please tell me ]
-Successfully replace status bar icon

Current features:
-Transparent/Black/White percentage label (Will use the most popular)
-Displays current percentage/charging status when clicked
-FIXED: bug where app needs to be tapped twice sometimes to update (V0.0.2)
-FIXED: Avoid the terminal window that opens for a split second (V0.0.3)
-FIXED: Deb package (without any terminal input) (V0.1.1)
-FIXED: Increase text size and make bold (V0.1.6)

VERSIONS:
0.0.1 - Initial Release
0.0.2 - Fixed: Execute the app twice to update percentage
0.0.4 - Fixed: No terminal window; Permissions no longer an issue; App Icon in PKG MGR
0.1.1 - Fixed Install of 0.0.4/0.0.5 with code modifications for faster execution (Will remain available for those who wish to have it the way it is shown in the screenshot)
0.1.2 - Removed graphic from background
0.1.3 - Cleaned up the code and put as much of the app as I can outside the home directory
0.1.5 - Fixed bug caused from changing files to /opt/BatteryWidget
0.1.6 - Made text larger and bolder


Any and all feedback/criticism is welcome.

juhapekka 2012-02-23 08:11

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Have you tried to use the QML BatteryInfo to get all the information, then just use the Qt Creator to do the project and packaging for you :)
http://doc.qt.nokia.com/qtmobility/qml-batteryinfo.html

EDIT: Misunderstood.. need more coffee.. :D ..anyway, you could use synchonization framework or timed for the auto updating?

et3rnal 2012-02-23 10:42

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
nice, would love to have it :D

F2thaK 2012-02-23 10:47

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Care to share?

Also, IMHO the text too small. 8-)

MFaroTusino 2012-02-23 11:55

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by F2thaK (Post 1168674)
Care to share?

Also, IMHO the text too small. 8-)

I know, I am looking at making it larger. Need to fiddel around still. Like I said, V 0.0.1 still very infant. Lots of improvements to come.

Share what exactly? The source?

slarti 2012-02-23 12:00

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by MFaroTusino (Post 1168694)
Share what exactly? The source?

The .zip would be good for starters...:rolleyes::D

Dousan 2012-02-23 12:01

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Nice work :)

I also think the txt is to small. Could it be an idea to ditch the battery icon and just have a solid white txt (21%) in the desktop/home screen app icon? It would fit in better with the rest of the UI/app icons imo ;)

Regards Dousan...

MFaroTusino 2012-02-23 12:25

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Sorry guys, didn't realise zip didn't attach, all good now :)

MFaroTusino 2012-02-23 12:27

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by Dousan (Post 1168699)
Nice work :)

I also think the txt is to small. Could it be an idea to ditch the battery icon and just have a solid white txt (21%) in the desktop/home screen app icon? It would fit in better with the rest of the UI/app icons imo ;)

Regards Dousan...

So just do solid text on the grey app icon? I don't see why not.

This was just done to get the technique of writing data to the image. In status bar, I will just replace the current fill of the battery with text :)

TMavica 2012-02-24 06:31

Looking forward for new update

MFaroTusino 2012-02-25 06:36

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Bit of an update guys,
Have managed to get the status bar to be locked to the one icon, and have altered the permissions (chmod) so the app can write to it.
At the moment the only issue is refreshing the status bar. If you know how to do this, please send me an email. I will make sure to credit your efforts

michaelmnb@hotmail.com.au

mariusmssj 2012-02-25 07:48

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
if you can make the text while and bold would look really nice :D

Dousan 2012-02-25 11:27

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
@MFaroTusino i can't make it work mate. When using your instructions as on first post i only get a green app icon on my desktop with 'Percent' written under it. When pressed a xterm window appears really quick, like a short flash.
I have a .BatteryWidget folder in /home/user/
How to make it work?

Regards Dousan...

MFaroTusino 2012-02-26 05:56

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by Dousan (Post 1169537)
@MFaroTusino i can't make it work mate. When using your instructions as on first post i only get a green app icon on my desktop with 'Percent' written under it. When pressed a xterm window appears really quick, like a short flash.
I have a .BatteryWidget folder in /home/user/
How to make it work?

Regards Dousan...

The xterm window is supposed to happen, at least for now. Need to work on that :). So when pressed, the icon doesn't update?

This may be because the icon hasn't been created properly, or also due to permission issues.

Try a few things;
1. The output of;
cd /home/user/.BatteryWidget/
ls -a


Should be;
BatteryWidget.py
BatteryWidget_Template.png
Icon_Widget.png
Percent.sh
percent.txt


2.
cd /usr/share/applications/
nano BatteryWidget.desktop


should have
icon=/home/user/.BatteryWidget/Icon_Widget.png

If they are all in place, check permissions
cd /home/user/.BatteryWidget
ls -l

And make sure that Icon_Widget.png is owned by/ allowed to be written to and executed by the user and not root

Cheers

tcbl50 2012-02-26 09:23

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by MFaroTusino (Post 1169833)
The xterm window is supposed to happen, at least for now. Need to work on that :). So when pressed, the icon doesn't update?

This may be because the icon hasn't been created properly, or also due to permission issues.

Try a few things;
1. The output of;
cd /home/user/.BatteryWidget/
ls -a


Should be;
BatteryWidget.py
BatteryWidget_Template.png
Icon_Widget.png
Percent.sh
percent.txt


2.
cd /usr/share/applications/
nano BatteryWidget.desktop


should have
icon=/home/user/.BatteryWidget/Icon_Widget.png

If they are all in place, check permissions
cd /home/user/.BatteryWidget
ls -l

And make sure that Icon_Widget.png is owned by/ allowed to be written to and executed by the user and not root

Cheers

I'm having the same problem.when I checked the directory /home/user/.BatteryWidget I noticed that the file Icon_Widget.png was not there! I've repeated the script several times but it doesn't seen to create that file. would love to have this app working.

MFaroTusino 2012-02-26 09:43

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Realised the issue many are facing is a dependency issue. Install python and python-imaging from terminal (apt-get install python python-imaging) and all should work.

Sorry that this slipped my mind, have updated the first post

Dousan 2012-02-26 10:04

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by MFaroTusino (Post 1169884)
Realised the issue many are facing is a dependency issue. Install python and python-imaging from terminal (apt-get install python python-imaging) and all should work.

Sorry that this slipped my mind, have updated the first post

Cheers mate that did the trick, now working as it should ;)

Regards Dousan...

MFaroTusino 2012-02-26 10:06

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by Dousan (Post 1169895)
Cheers mate that did the trick, now working as it should ;)

Regards Dousan...

Glad to hear:) How is it with updating? Do you need to tap twice to update occasionally?

Dousan 2012-02-26 10:15

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by MFaroTusino (Post 1169896)
Glad to hear:) How is it with updating? Do you need to tap twice to update occasionally?

I only need to tap it once to update it. It's not updating by itself.

Regards Dousan...

e: i need to tap it twice to update, tried it 4 times after my post and all of them needed a double tap.

MFaroTusino 2012-02-26 10:22

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by Dousan (Post 1169897)
I only need to tap it once to update it. It's not updating by itself.

Regards Dousan...

Okay, for me I occasionally need to run app twice. At this stage (V0.0.1) update is only manually done, by tapping icon. Auto-update should be coming soon :)

tcbl50 2012-02-26 11:12

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
working now thanks

Dousan 2012-03-08 09:06

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
@MFaroTusino any news/update on this fine app/widget/desktop icon?

Regards Dousan...

MFaroTusino 2012-03-08 10:02

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
There has been a problem with packaging that I can't seem to fix. That is my first goal for the time being.

I have an action plan to resolve changing the icon in the status bar, and it has been successful. I just need to develop a method of altering multiple files, otherwise I need to refresh the status bar each time, and that will drain more battery.

It is taking longer as my uni schedule is pretty heavy at the moment and only have about 6hours a week free. Hopefully shouldn't be too much longer.

MFaroTusino 2012-04-06 12:32

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Updated install info is on first post.

Provide some feedback please.

accountvip 2012-04-06 15:41

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Install deb file.
Install python python-imaging.
chmod 777 /home/user/.BatteryWidget/*
chmod 777 /opt/BatteryWidget/*

I see icon battery on homescreen but don't see the percent on icon....

MFaroTusino 2012-04-07 10:28

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by accountvip (Post 1188879)
Install deb file.
Install python python-imaging.
chmod 777 /home/user/.BatteryWidget/*
chmod 777 /opt/BatteryWidget/*

I see icon battery on homescreen but don't see the percent on icon....

You will need to tap the icon to update it or does that not work?

accountvip 2012-04-07 14:18

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
I tap the icon and Terminal is open 1s then close. Nothing on icon......

MFaroTusino 2012-04-08 11:10

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by accountvip (Post 1189299)
I tap the icon and Terminal is open 1s then close. Nothing on icon......

can you run manually sh /home/user/.BatteryWidget/percent.sh ?

accountvip 2012-04-08 11:22

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by MFaroTusino (Post 1189673)
can you run manually sh /home/user/.BatteryWidget/percent.sh ?

It's working, now on the icon show percent of battery. But alignment is bottom-right not center.

MFaroTusino 2012-04-08 11:25

Re: [Announce] Battery Percentage 'widget' for Nokia N9
 
Quote:

Originally Posted by accountvip (Post 1189677)
It's working, now on the icon show percent of battery. But alignment is bottom-right not center.

I realised, i used a width/2, height/2 alignment but it didn't work. V 0.0.3 is back to the old way of using it, with fixed placement. It also uses bold text and is white. Should be finished next week

accountvip 2012-04-08 12:13

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.1
 
Autoupdate and tap on it not work. When tap on the icon terminal open and close so fast, i see problem in percent.sh.

MFaroTusino 2012-04-08 12:16

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.1
 
Quote:

Originally Posted by accountvip (Post 1189688)
Autoupdate and tap on it not work. When tap on the icon terminal open and close so fast, i see problem in percent.sh.

Can you try as root;
chown user /home/user/.Batterywidget/*

accountvip 2012-04-08 12:44

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.1
 
Quote:

Originally Posted by MFaroTusino (Post 1189690)
Can you try as root;
chown user /home/user/.Batterywidget/*

root and user can't do that. opensh is ok, it working now.
Watting for your update......

MFaroTusino 2012-04-08 12:52

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.1
 
Quote:

Originally Posted by accountvip (Post 1189700)
root and user can't do that. opensh is ok, it working now.
Watting for your update......

Thanks for that, forgot i was in OpenMode, have updated instructions to direct users to inception and opensh.

Hopefully I will solve it in 0.0.3.

Thanks for providing important feedback

MFaroTusino 2012-04-08 12:56

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.2
 
V 0.0.2 has been packaged and uploaded

Text is still misaligned but the double execution of the app to update bug has been fixed. (At least that I can tell.)

As always, feedback is essential :)

MFaroTusino 2012-04-09 08:29

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.2
 
v 0.0.3 is currently being packaged.

Fixes :
Terminal window no longer appears
Text is back to being centred
Font is white as requested (Although I think it is less readable) - Feedback is needed

Bugs:
Permissions error is still an issue (If you know a solution, PM me :) )
Bold font not yet implemented

Update:

I have scrapped 0.0.3 and am jumping ahead to 0.0.4
Fixes:
Same as 0.0.3 plus;
Permissions is no longer an issue
Package in App Manager now has icon

Bugs:
Bold is still not implemented

MFaroTusino 2012-04-10 03:00

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.4
 
Seems 0.0.4 has an issue executing the postinstall script.

Working on a fix, sorry guys

Update: Packaging 0.0.5 now, pretty sure it wil fix the bug from 0.0.4
Fingers crossed

MFaroTusino 2012-04-13 12:42

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.4
 
V 0.1.1 Now released, DL link if OP

Fixed:
Install bug from 0.0.4/0.0.5
Faster execution of code

Bugs:
Auto update not successful
Text not correctly centred

As always, give feedback guys.
Want to know if you like the White text better. Will release Transparent, Black and White options shortly for comparisons

coderus 2012-04-13 12:53

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.4
 
require python?

MFaroTusino 2012-04-14 14:22

Re: [Announce] Battery Percentage 'widget' for Nokia N9 - V0.0.4
 
Quote:

Originally Posted by coderus (Post 1191622)
require python?

Yes, python and python-imaging


All times are GMT. The time now is 08:55.

vBulletin® Version 3.8.8