You are not logged in.
It's a fork of slimebattery-git app, but written on Python. Slimebattery is also good app, but have segfaults.
Here it is. and AUR
Last edited by decay_of_mind (2011-09-30 22:06:07)
Offline
What icon theme and panel is that you're using?
Thanks
PGP key: F40D2072
Key fingerprint: 8742 F753 5E7B 394A 1B04 8163 332C 9C40 F40D 2072
Offline
It's Faenza and looking at the October screenshot thread, I assume that is Lxpanel.
Decay, I have been looking for a small battery monitor that worked for a long time! I just came across tint2's built in battery monitor, otherwise I definitely would've tried yours!
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
Offline
you are right - Faenza-Dark and lxpanel
Offline
Fab! Finally a battery monitor that Just Works. Thank you kindly.
Offline
I am excited to use this script. I have built it from AUR, it starts and reports battery information properly, however, I do not have a proper icon (there is a red 'x' with some themes, other themes are just blank). I've installed quite a few icon themes (and switched to them using 'lxappearance'), but I am obviously missing a vital piece. I do not have lxde installed, just fluxbox and X.
gnome-icon-theme 3.2.1.2-1
gnome-icon-theme-extras 3.0.0-1
gnome-icon-theme-symbolic 3.2.1-1
gtk-update-icon-cache 2.24.8-2
hicolor-icon-theme 0.12-1
human-icon-theme 0.36-2
icon-naming-utils 0.8.90-2
kdeartwork-iconthemes 4.7.3-1
lxde-icon-theme 0.0.1-1
oxygen-icons 4.7.3-1
tangerine-icon-theme 0.26-5
xf86-video-siliconmotion 1.7.5-3
Offline
Using now. Great application. Thanks.
- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -
Offline
I am excited to use this script. I have built it from AUR, it starts and reports battery information properly, however, I do not have a proper icon (there is a red 'x' with some themes, other themes are just blank).
Same here with Openbox and Tint2. Tidybattery shows just a white "paper"-icon with a red cross on it. The icon shows an on-mouse-over effect that says in my case:
unknown, 97%
Any hint on how to get a proper icon would be appreciated
Last edited by swordfish (2012-03-04 12:37:54)
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
Same here, only red X
Offline
One solution is to copy all status icons from Faenza Dark to your icon theme of choice. Of course, that will destroy all nice status icons in that icon theme. In Faenza Dark the png's are called 'gpm-battery-xxx-xxx.png' and 'gpm-primary-xxx-xxx.png', or the like. You could also copy each and every one of them manually for all sizes and scalable too. That would preserve your present status icons and just add the necessary ones.
Offline
Gentoo/Openbox user here
This is fantastic.
I've been mad at xfce4-power-manager for a while now because while its interface is pretty much the same as this (which is what I want), it likes to not realize that i've removed the power adaptor, or plugged it back in, and so on. So I sat there wondering why there didn't seem to be a battery monitor that just polled acpi periodically, and ended up just writing a shell script that just outputs the %
...but this is much, much nicer It's people like you that make me miss my Arch days.
Last edited by malachi (2012-04-24 06:48:13)
Offline
unknown, 97%
This script is just polling an acpi status from "acpi -i" output.
So, if you got an Unknown status in acpi -i output and you have ThinkPad, it possibly means "Charging".
Offline
I can't download this. 403
Offline
One solution is to copy all status icons from Faenza Dark to your icon theme of choice. Of course, that will destroy all nice status icons in that icon theme. In Faenza Dark the png's are called 'gpm-battery-xxx-xxx.png' and 'gpm-primary-xxx-xxx.png', or the like. You could also copy each and every one of them manually for all sizes and scalable too. That would preserve your present status icons and just add the necessary ones.
Trying this solution, but it's not yet working for me. I have openbox and Clearlooks is my default theme. After I copied all Faenza-Dark png's from status/16 to /usr/share/themes/Clearlooks same red cross persists. Thanks for any tips!
Offline
Found my solution:
Specify in file
/etc/gtk-2.0/gtkrc
gtk-fallback-icon-theme = "Faenza-Dark"
Offline
I had a problem where this script would crash after suspending my laptop due to the output of acpi not matching the desired result, i've modified the script to check to make sure the output matches using a regular expression and i also modified the icons to use the xfce4-battery-* icons. Here is my modified version of the script:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
import gtk
import gobject
import subprocess
import re
ACPI_CMD = 'acpi'
TIMEOUT = 2
class MainApp:
def __init__(self):
self.icon = gtk.StatusIcon()
self.update_icon()
gobject.timeout_add_seconds(TIMEOUT,self.update_icon)
def get_battery_info(self):
text = subprocess.check_output(ACPI_CMD).strip('\n')
if(re.match("[^:]+:[^,]+,.+",text)):
data = text.split(',')
return {'state':data[0].split(':')[1].strip(' '),
'percentage':int(data[1].strip(' %')),
'tooltip': text.split(':',1)[1][1:]
}
def get_icon_name(self, state, percentage):
if state == 'Discharging':
if percentage < 10:
return 'xfce4-battery-critical'
elif percentage < 40:
return 'xfce4-battery-low'
elif percentage < 75:
return 'xfce4-battery-ok'
else:
return 'xfce4-battery-full'
else:
if percentage < 10:
return 'xfce4-battery-critical-charging'
elif percentage < 40:
return 'xfce4-battery-low-charging'
elif percentage < 75:
return 'xfce4-battery-ok-charging'
else:
return 'xfce4-battery-full-charging'
def update_icon(self):
info = self.get_battery_info()
icon_name = self.get_icon_name(info['state'],info['percentage'])
self.icon.set_from_icon_name(icon_name)
self.icon.set_tooltip_text(info['tooltip'])
return True
if __name__ == "__main__":
try:
MainApp()
gtk.main()
except KeyboardInterrupt:
pass
HP DV6 + Arch + Openbox
Offline
I had a problem where this script would crash after suspending my laptop due to the output of acpi not matching the desired result
I had the same problem, and I fixed it before reading the page to the end and finding your solution.
My solution is just a bit different (I've added new icon if output of 'acpi' command can't be parsed):
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
import gtk
import gobject
import subprocess
ACPI_CMD = 'acpi'
TIMEOUT = 2
class MainApp:
def __init__(self):
self.icon = gtk.StatusIcon()
self.update_icon()
gobject.timeout_add_seconds(TIMEOUT,self.update_icon)
def get_battery_info(self):
text = subprocess.check_output(ACPI_CMD).strip('\n')
if not 'Battery' in text:
return {'state':"Unknown",
'percentage':0,
'tooltip':""
}
data = text.split(',')
return {'state':data[0].split(':')[1].strip(' '),
'percentage':int(data[1].strip(' %')),
'tooltip': text.split(':',1)[1][1:]
}
def get_icon_name(self, state, percentage):
if state == 'Discharging':
if percentage < 10:
return 'battery_empty'
elif percentage < 20:
return 'battery_caution'
elif percentage < 40:
return 'battery_low'
elif percentage < 60:
return 'battery_two_thirds'
elif percentage < 75:
return 'battery_third_fouth'
else:
return 'battery_full'
elif state == 'Charged':
return 'battery_charged'
elif state == 'Unknown':
return 'dialog-question'
else:
return 'battery_plugged'
def update_icon(self):
info = self.get_battery_info()
icon_name = self.get_icon_name(info['state'],info['percentage'])
self.icon.set_from_icon_name(icon_name)
self.icon.set_tooltip_text(info['tooltip'])
return True
if __name__ == "__main__":
try:
MainApp()
gtk.main()
except KeyboardInterrupt:
pass
Offline
Sorry, guys.
Big part of my IT life has changed and I do not use ArchLinux anymore. So, I've realized, that you folks use my simple scripts. I made repo on github and updated PKGBUILD's on AUR.
Enjooy!
Offline
Hey there,
I forked the github repo and created a modified version of the application.
The application that I created is for systems with dual battery setups (like the Thinkpad X240).
you can find the modified version here
https://aur.archlinux.org/packages/dualtidy/
Hope you guys like it
Offline
Hey there,
New update, now it supports one battery and more.
Thanks to mynameisfiber [https://github.com/mynameisfiber]
Offline
The AUR links are giving me a 404.
Offline