You are not logged in.

#101 2009-05-01 14:18:54

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

In this case (with Python) I don't think so - but imports should be investigated.

With dynamic executables you can use the ldd command.

I forgot to mention in the other post, that you should probably also put the md5sum of batterymon-1.2.0.tar.gz in the PKGBUILD file: md5sums=('23bcd745daf5508005284ebd61c29c2b')

Edit 1: And now that we're at it, pygtk should also be listed as a dependency. smile

Edit 2: I also suggest changing "You do not seem to have libnotify installed. Notifications won't work." to "You do not seem to have notify-python installed. Notifications won't work.". In Arch notify-python is called python-notify, but notify-python will be more generic I think, as it is it's correct name.

Last edited by Lars Stokholm (2009-05-01 14:47:12)

Offline

#102 2009-05-01 14:19:16

kperkins
Member
Registered: 2009-03-31
Posts: 11

Re: Batterymon -- a simple battery monitor ideal for openbox etc

Thanks Matthew.  I've been using this on lxpanel instead of their super ugly one, and the new tool tips make it super awesome.

Just a couple of bugs I noticed.  Tool tip you have remainging instead of remaining.  also, when you first unplug the power cord it reads time remaining wrong (mine showed 24+ hours--that would be nice, but it's not possible), it shows it right after a few minutes, but not until it's down to about 95-96%.

Last edited by kperkins (2009-05-01 14:31:15)

Offline

#103 2009-05-01 14:58:55

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

I can't get notifications to work. When I unplug the AC I get this:

ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 214, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/bin/batterymon", line 78, in __on_property_modified
    self.update()
  File "/usr/bin/batterymon", line 64, in update
    self.property_modified_handler(present)
  File "/usr/bin/batterymon", line 433, in __ac_property_modified_handler
    listener.ac_property_modified(present)
  File "/usr/bin/batterymon", line 459, in ac_property_modified
    self.n.notify("On Battery", "AC adapter unplugged, running on battery","full")
  File "/usr/bin/batterymon", line 396, in notify
    n.show()
GError: The name org.freedesktop.Notifications was not provided by any .service files

Edit: Seems I need notification-daemon which depends on a lot of crap. Too bad, but I can live with just the icon. smile

Last edited by Lars Stokholm (2009-05-01 15:07:20)

Offline

#104 2009-05-01 15:39:43

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

md5sum is now added to the pkgbuild and i'll fix the dependancie problems later.

thank smile

i just noticed on my new openbox install the same problem with notifications i might see if i can find another way as sonata is still able to show notifications but batterymon can't.

i'll also look into the hal problem and the typos later tonight smile

Thanks for the feed back.


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#105 2009-05-01 16:50:21

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

genisis300 wrote:

i just noticed on my new openbox install the same problem with notifications i might see if i can find another way as sonata is still able to show notifications but batterymon can't.

You've got a point about Sonata: There must be another way. I'm using Openbox too btw.

Offline

#106 2009-05-01 17:59:57

NeoXP
Member
From: MS Matrix
Registered: 2009-01-09
Posts: 206
Website

Re: Batterymon -- a simple battery monitor ideal for openbox etc

Me three on OpenBox.:D

I started the program from the commandline, working as it supposed to be. Got a notification at 15% (just as I would expect), plugged in the powersupply and got a notification for that to.

Everything working just fine I thought, but in the terminal where I ran the command I got the following output:

enne@persephone [~/]
-> 2009-05-01 19:54:08,996 - batterymon - ERROR - org.freedesktop.Hal.NoSuchProperty: No property battery.remaining_time on device with id /org/freedesktop/Hal/devices/computer_power_supply_battery_C1E9
2009-05-01 19:54:08,996 - batterymon - ERROR - org.freedesktop.Hal.NoSuchProperty: No property battery.remaining_time on device with id /org/freedesktop/Hal/devices/computer_power_supply_battery_C1E9
2009-05-01 19:54:09,949 - batterymon - ERROR - org.freedesktop.Hal.NoSuchProperty: No property battery.remaining_time on device with id /org/freedesktop/Hal/devices/computer_power_supply_battery_C1E9
2009-05-01 19:54:09,949 - batterymon - ERROR - org.freedesktop.Hal.NoSuchProperty: No property battery.remaining_time on device with id /org/freedesktop/Hal/devices/computer_power_supply_battery_C1E9

Arch x86_64 on HP 6820s and on HP nx9420. Registered Linux User 350155, since 24-03-2004
"Everyone said that it could not be done, until someone came along who didn't know that."

Offline

#107 2009-05-01 20:47:07

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

that seems to happen if the battery is 100% full and is no longer charging i get it all the time. i need to see if i can hide that smile


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#108 2009-05-01 21:19:02

nsb
Member
From: Switzerland
Registered: 2008-03-26
Posts: 57

Re: Batterymon -- a simple battery monitor ideal for openbox etc

Thank you very much for your wonderfull work! This one works perfectly big_smile

Regards
nsb

Offline

#109 2009-05-02 15:00:17

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

One little thing... When the battery is charging, tool tip text is on one line. When not charging, tool tip text is split on two lines. It would be nice it the tool tip was a little more consistent. Personally I prefer just one line, with some sort of separation (comma or dash), but I'll leave that decision to you. smile

Edit: A very minimalistic idea: "<battery level> (<status>)" ie. "45% (charging)", "100% (idle)", "79% (discharging)". No need for a lot of text, eh? smile

Last edited by Lars Stokholm (2009-05-02 15:08:55)

Offline

#110 2009-05-02 15:11:40

Eax
Member
From: Denmark
Registered: 2009-02-04
Posts: 40
Website

Re: Batterymon -- a simple battery monitor ideal for openbox etc

Hmm I get some pretty weird errors:

/usr/bin/batterymon:244: GtkWarning: Unable to locate theme engine in module_path: "murrine",
  self.tray_object= gtk.StatusIcon()
Traceback (most recent call last):
  File "/usr/bin/batterymon", line 518, in <module>
    pm = PowerManager()
  File "/usr/bin/batterymon", line 423, in __init__
    self.adapter = AcAdapter()
  File "/usr/bin/batterymon", line 46, in __init__
    DBusObject.__init__(self)
  File "/usr/bin/batterymon", line 39, in __init__
    hal_obj = self.bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/Manager')
  File "/usr/lib/python2.6/site-packages/dbus/bus.py", line 244, in get_object
    follow_name_owner_changes=follow_name_owner_changes)
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 241, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python2.6/site-packages/dbus/bus.py", line 183, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python2.6/site-packages/dbus/bus.py", line 281, in start_service_by_name
    'su', (bus_name, flags)))
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 622, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Hal was not provided by any .service files

Any ideas? Oo

Offline

#111 2009-05-02 17:30:56

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

@Eax: Have you started HAL?

Last edited by Lars Stokholm (2009-05-02 17:38:55)

Offline

#112 2009-05-02 20:16:39

Eax
Member
From: Denmark
Registered: 2009-02-04
Posts: 40
Website

Re: Batterymon -- a simple battery monitor ideal for openbox etc

@Lars Stokholm:
Nope; I hadn't. Thanks smile
Hmm, it interferes with WICD >_<

Last edited by Eax (2009-05-02 20:17:46)

Offline

#113 2009-05-03 01:08:55

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

i'm using wicd and batterymon and not had any problems?

What kind of issues are you having?


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#114 2009-05-03 11:03:26

Eax
Member
From: Denmark
Registered: 2009-02-04
Posts: 40
Website

Re: Batterymon -- a simple battery monitor ideal for openbox etc

@genisis300: When I installed wicd it asked me to outcomment hal in rc.conf .. Is it safe to remove the "!"?

Offline

#115 2009-05-03 12:18:17

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

remove the ! from wicd or hal?
this is my daemons line

DAEMONS=(@preload @acpid syslog-ng @network @netfs @crond @alsa hal wicd @mpd @cpufreq)


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#116 2009-05-03 14:56:52

Eax
Member
From: Denmark
Registered: 2009-02-04
Posts: 40
Website

Re: Batterymon -- a simple battery monitor ideal for openbox etc

Sorry smile From hal

What does @ do?

Offline

#117 2009-05-03 15:00:14

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

@ starts the daemon in the background. You can speed up your boot by adding @ to a lot of them. Just don't do it with HAL as other daemons might depend on it being started.

Btw, the wiki for Wicd explicitly says you have to add HAL to the daemons array.

Last edited by Lars Stokholm (2009-05-03 15:05:37)

Offline

#118 2009-05-03 15:10:16

Eax
Member
From: Denmark
Registered: 2009-02-04
Posts: 40
Website

Re: Batterymon -- a simple battery monitor ideal for openbox etc

Lars Stokholm: Okay thanks a lot smile I remember it as I had to put the ! in front Oo

Last edited by Eax (2009-05-03 15:10:42)

Offline

#119 2009-05-03 15:23:37

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

it send the daemon to the background. (Doesn't wait for it to finish loading)

it can be done on alot of daemons that are not essential to your system loading

Hal must be running before wicd hence there is no @  (if i rember correctly)

Last edited by genisis300 (2009-05-03 15:23:56)


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#120 2009-05-03 16:24:26

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

i may have found a temp solution to the notification problem,
it appears that there has to be a notification-deamon running for it to work.

so i found xfce4-notifyd a very small notification daemon.

i'm still looking for alternative fixes but this one works at the moment.


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#121 2009-05-04 18:55:23

genisis300
Member
From: Uk
Registered: 2008-01-15
Posts: 284

Re: Batterymon -- a simple battery monitor ideal for openbox etc

I'm going to be doing some more work on this in the next day or so.

I'm looking to see if there are any feature requests for the next version?

Regards
Matthew


"is adult entertainment killing our children or is killing our children entertaining adults?" Marilyn Manson

Offline

#122 2009-05-04 19:40:59

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

None other than KISS. smile If you fix a few things (the ones I've mentioned) I'd say it's perfect, hehe.

Offline

#123 2009-05-11 19:58:28

SiD
Member
From: Germany
Registered: 2006-09-21
Posts: 729

Re: Batterymon -- a simple battery monitor ideal for openbox etc

I just installed version 1.2.0-6 from AUR and get this error

$ batterymon 
You do not seem to have libnotify installed. Notifications won't work.
Traceback (most recent call last):
  File "/usr/bin/batterymon", line 523, in <module>
    pm.update()
  File "/usr/bin/batterymon", line 441, in update
    battery.update()
  File "/usr/bin/batterymon", line 122, in update
    is_charging = self.__battery.GetProperty('battery.rechargeable.is_charging')
  File "/usr/lib/python2.6/site-packages/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/python2.6/site-packages/dbus/connection.py", line 622, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.Hal.NoSuchProperty: No property battery.rechargeable.is_charging on device with id /org/freedesktop/Hal/devices/computer_power_supply_battery_BAT1

libnotify is installed

pacman -Qs libnotify
local/libnotify 0.4.5-1.1
    Desktop notification library

Offline

#124 2009-05-11 20:18:45

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Batterymon -- a simple battery monitor ideal for openbox etc

@SiD: The exception has nothing to do with libnotify, but try sending the output of 'lshal -u `hal-find-by-capability --capability battery`'. It seems you're missing "battery.rechargeable.is_charging".

Edit (x 117): F*cked a few things up. smile

Last edited by Lars Stokholm (2009-05-11 20:25:23)

Offline

#125 2009-05-11 20:19:26

scio
Member
From: Buffalo, NY
Registered: 2008-08-05
Posts: 366

Re: Batterymon -- a simple battery monitor ideal for openbox etc

SiD wrote:

I just installed version 1.2.0-6 from AUR and get this error

$ batterymon 
You do not seem to have libnotify installed. Notifications won't work.
...

Did you see this:

Lars Stokholm wrote:

...
Edit 2: I also suggest changing "You do not seem to have libnotify installed. Notifications won't work." to "You do not seem to have notify-python installed. Notifications won't work.". In Arch notify-python is called python-notify, but notify-python will be more generic I think, as it is it's correct name.

Not sure, but I would guess you don't have python-notify installed.

Offline

Board footer

Powered by FluxBB