SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#26 2015-03-25 00:17:42

heart1010
Member
Registered: 2015-03-13
Posts: 16

Re: [SOLVED] Battery icon in tint2

nicholasalipaz wrote:
heart1010 wrote:

...
I've installed tidybattery and I also get an "icon" which shows on mouse hover the needed data but this icon looks like a monitor/terminal and not like power/accu icon  cool (did I something false)!?

http://storage4.static.itmages.com/i/15/0324/s_1427229016_7335940_5dbf1b9eec.png

Looks like your icon theme might not have the icons named in the script.  You could try a different icon theme or create your own to add to the theme you are using, assuming that is indeed the issue.  What icon theme are you using?

I use FlatWoken... which icons have to be there exactly?

update: ok, I got it... I changed the battery icon names in tidybattery script to match with FlatWoken icon names, now everything is ok  cool

Last edited by heart1010 (2015-03-25 00:29:53)

Offline

Help fund CrunchBang, donate to the project!

#27 2015-03-25 05:49:21

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: [SOLVED] Battery icon in tint2

@heart1010, i had the same problem.

instead of changing the icon names, i changed the inherits in my icon theme's index.theme.
it's a long-term solution.
imho, something should always inherit Faenza, and that should inherit Gnome.

in other words, on my machine tidybattery is using Faenza's battery icons now because my actual current icon theme doesn't have them, so it inherits them from faenza.

ask if you don't understand what i'm talking about here.

Offline

#28 2015-03-25 07:22:37

heart1010
Member
Registered: 2015-03-13
Posts: 16

Re: [SOLVED] Battery icon in tint2

@ohnonot I changed the icon names and also added percentage values also in the charging section because in FlatWoken I have icons for every 20% steps (two times, one for normal battery and the same % icon with a charging symbol). So this is ok for that tidybattery script.

But I'm interested how to "inherit a icon thems's index.theme" so it takes status/battery icons from another theme?

Offline

#29 2015-03-25 09:10:43

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: [SOLVED] Battery icon in tint2

I haven't tried it, but there's fdpowermon in the repos.  Description from the Jessie repo:

fdpowermon is a simple perl script that installs an icon in a system tray compatible with the freedesktop.org specification.

Every three seconds, fdpowermon calls acpi to find out what the current battery level is. It will set the output of the acpi command as a tooltip text, and will update the used icon as appropriate.

In addition, fdpowermon can optionally call perl subroutines when the power reaches a given level. No such subroutines are provided or enabled by default, however.

Last edited by KrunchTime (2015-03-25 09:11:51)


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#30 2015-03-25 09:33:07

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: [SOLVED] Battery icon in tint2

I installed fdpowermon a few minutes ago.  It's not too bad, but it doesn't appear to accurately represent the remaining battery level graphically.  The screenshot below was at 40% charge level.  It also doesn't appear to be themeable by openbox or lxappearance.  Mousing over the icon gives current battery level as a percentage and the remaining amount of run time.

2015_03_25_1427275452_218x29_scrot.jpg

Last edited by KrunchTime (2015-03-25 09:36:26)


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#31 2015-03-25 12:13:20

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,434

Re: [SOLVED] Battery icon in tint2

heart1010 wrote:

...
But I'm interested how to "inherit a icon thems's index.theme" so it takes status/battery icons from another theme?

If you look in an icon's directory (eg ~/.icons/name-of-icon or /usr/share/icons/name-of-icon) and open the index.theme file, the first lines will be something like

[Icon Theme]
Name=Faenza-CrunchBang
Inherits=gnome,hicolor
....
....

You can also copy in icons you like from elsewhere, to replace the theme defaults.

Some light bedtime reading: freedesktop.org "Icon Theme Specification"

Last edited by damo (2015-03-25 12:15:09)


BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator smile

Offline

#32 2015-03-25 16:03:56

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

on side-note, I was curious why all these icon packages tend to use different naming conventions.  Looks like there is no official naming convention for battery levels aside from `battery`, `battery-low`, and `battery-caution`.  http://standards.freedesktop.org/icon-n … tml#status

Offline

#33 2015-03-25 16:33:39

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

@heart1010, it also looks as though it is fairly common practice to symlink image names in the iconset.  So you could just symlink the name of the icon in the script to the expected icon in your icon pack.

$ cd /usr/share/icons/[your-icon-theme]/
$ sudo su # you might need to be root if your icon theme is owned by him.
$ find . -name "battery-low.png" -execdir ln -s {} battery_low.png \;

Repeat find command with the name to find (battery-low.png) and name to symlink to (battery_low.png) in the above for each of the icons.

Offline

#34 2015-03-26 01:34:06

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

I have just forked the tidybattery project 'cause I really liked it.  I have made a version that works with the nouveGnomeGrey theme icons specifically, but icon names can be changed in the file.  seems there isn't a standard naming convention for step-wise indication of battery level.
https://github.com/nalipaz/tidybattery
Let me know if anyone tries it out.  This version can also run a command on left click by specifying with the -c flag.

(sleep 2s && tidybattery -c xfce4-power-manager-settings) &

is what I have in my autostart.

Offline

#35 2015-03-26 20:05:35

ohnonot
...again
Registered: 2012-05-22
Posts: 2,205

Re: [SOLVED] Battery icon in tint2

@nicholasalipaz: oh, how beautiful is that.

it seems you added an array of different icon names for each battery state? so it is in fact more flexible now?

and the "-c" option is just the perfect little addon to once-and-for-all work around that xfce4-power-manager bug!

Offline

#36 2015-03-26 20:57:46

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: [SOLVED] Battery icon in tint2

nicholasalipaz wrote:

I have just forked the tidybattery project 'cause I really liked it.  I have made a version that works with the nouveGnomeGrey theme icons specifically, but icon names can be changed in the file.  seems there isn't a standard naming convention for step-wise indication of battery level.
https://github.com/nalipaz/tidybattery
Let me know if anyone tries it out.  This version can also run a command on left click by specifying with the -c flag.

(sleep 2s && tidybattery -c xfce4-power-manager-settings) &

is what I have in my autostart.

Instead of maintaining your own fork, have you tried if the original author is interested in your patches? Perhaps he will welcome a pull request and we'll have one fork less in the Linux world smile


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#37 2015-03-26 21:27:48

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

Yes to both questions, configurable python dictionary of icons.  maybe it could be moved to a config file to avoid having to modify source, and then provide a very standard default.  As to submitting the pull request to the original maintainer, there hasn't been any new development on the project since 2013, but heck why not.  Just see what might happen, but I will wait a bit until I decide on better solution for the icon specifications.

Offline

#38 2015-03-26 21:36:08

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

BTW, I did write a version that did dbus notifications as well, but scrapped the functionality to reduce the code by about 30-50 lines and anyhow xfce4-power-manager already does the notifications if you enable it so it was duplicate functionality on my system.   Not to mention it doesn't seem like something necessary for this particular project, keep the project on one functionality, a gtk icon that indicates the power level.

BTW, tidybattery is already a fork of slimebattery, albeit slimebattery was written in C and is about 300 lines of code versus our ~100 lines of python.

Offline

#39 2015-03-27 10:41:52

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: [SOLVED] Battery icon in tint2

nicholasalipaz wrote:

As to submitting the pull request to the original maintainer, there hasn't been any new development on the project since 2013, but heck why not.

That does not mean it's not supported/developed anymore, maybe the developer just deems it feature complete.

nicholasalipaz wrote:

BTW, tidybattery is already a fork of slimebattery, albeit slimebattery was written in C and is about 300 lines of code versus our ~100 lines of python.

LOC is not really a good metric to use, especially not when comparing two completely different programming languages.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#40 2015-03-27 15:44:02

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

Unia wrote:
nicholasalipaz wrote:

As to submitting the pull request to the original maintainer, there hasn't been any new development on the project since 2013, but heck why not.[..but I will wait a bit until I decide on better solution for the icon specifications.]

That does not mean it's not supported/developed anymore, maybe the developer just deems it feature complete.

I think you are misunderstanding me, I do agree there is a chance it is still in development/maintained and I do plan to submit a PR.

Unia wrote:
nicholasalipaz wrote:

BTW, tidybattery is already a fork of slimebattery, albeit slimebattery was written in C and is about 300 lines of code versus our ~100 lines of python.

LOC is not really a good metric to use, especially not when comparing two completely different programming languages.

I am not using LOC as any sort of metric here, only trying to state that tidybattery is already a fork as it is.

Offline

#41 2015-03-27 17:13:41

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: [SOLVED] Battery icon in tint2

There was no misunderstanding, I only wanted to point out that inactivity on GitHub is not to be taken as an indication of a project's state, which seems to be a common misconception.

Regarding the LOC thing, you've been pointing it out a few times while (in my opinion) it's not relevant. This led me to believe you did use it as a metric. Sorry if I was wrong  smile


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#42 2015-03-27 17:40:39

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

Unia wrote:

Regarding the LOC thing, you've been pointing it out a few times while (in my opinion) it's not relevant. This led me to believe you did use it as a metric. Sorry if I was wrong  smile

I think I only pointed it out once actually, to which you replied it was not a metric.  Others did however mention the amount of lines in the project earlier than I, but we digress.

Let me know if anyone has any opinions on how you would prefer icons be configured for tidybattery.  I am leaning towards a config file.

Offline

#43 2015-03-27 17:44:52

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

nicholasalipaz wrote:

Let me know if anyone has any opinions on how you would prefer icons be configured for tidybattery.  I am leaning towards a config file.

Actually, looking at python's ConfigParser, it is easy as pie.  I am convinced.

Offline

#44 2015-03-28 08:19:52

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

I finished up rewriting my fork to use a config file:
https://github.com/nalipaz/tidybattery/releases/tag/1.1

I will be submitting a pull request now.

Offline

#45 2015-03-28 10:32:04

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: [SOLVED] Battery icon in tint2

^ Thank you for your efforts, nicholasalipaz.  Keep us posted.


Linux User #586672
Come and Die -- Kyle Idleman

Offline

#46 2015-03-30 16:13:26

nicholasalipaz
#! Member
Registered: 2015-02-05
Posts: 72

Re: [SOLVED] Battery icon in tint2

KrunchTime wrote:

^ Thank you for your efforts, nicholasalipaz.  Keep us posted.

My changes were merged into master of the tidybattery project today.
https://github.com/decayofmind/tidybattery/pull/1

Hope others might get some usage out of the additions I added.

Offline

#47 2015-03-30 16:29:24

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,634
Website

Re: [SOLVED] Battery icon in tint2

Nice work! smile


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#48 2015-03-30 16:38:44

hhh
Cityspeak
Registered: 2010-08-04
Posts: 3,253

Re: [SOLVED] Battery icon in tint2

New forum member effort FTW!  smile Bravo.


bunsenlabs     8)     forum mod squad

Offline

#49 2015-03-31 03:02:13

KrunchTime
#! Die Hard
From: not where I belong
Registered: 2012-03-02
Posts: 3,264

Re: [SOLVED] Battery icon in tint2

Standing ovation!!  wink

BunsenLabs FTW!!!!  smile

Last edited by KrunchTime (2015-03-31 03:03:55)


Linux User #586672
Come and Die -- Kyle Idleman

Offline

Help fund CrunchBang, donate to the project!

#50 2015-03-31 09:01:27

heart1010
Member
Registered: 2015-03-13
Posts: 16

Re: [SOLVED] Battery icon in tint2

Thanks nicholasalipaz!!!

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo