Battery indicator for Openbox

This is where all the old topics get sent after some time. Read-only.

Moderators: NYbill, Fab, Dan

Battery indicator for Openbox

Postby mjjzf on 11 Nov 2008, 13:41

So, a question I have asked many places:
I am using Openbox with Pypanel. And that is fine, except I don't have a battery monitor, and that is necessary for me, since I use my laptop on the road a lot. Now, the thing is: It should be in the system tray, so I can see it even if I am running maximized programs. This rules out programs like Conky and desklets in general. Dependencies are not too important - I am willing to lose a bit of space and resources for this function.
Any pointers?
User avatar
mjjzf
Cutpurse
Cutpurse
 
Posts: 1624
Joined: 10 Aug 2008, 11:30
Location: Brooklyn, New York - USA
Distro: Slackware
Desktop: Xfce
CLI Editor: Vim
GUI Editor: Medit

Re: Battery indicator for Openbox

Postby timttmy on 11 Nov 2008, 18:59

I'm not familiar with pypanel but can you add batmon or lm-batmon to it?
Timttmy. It's an unpronounceable user name. Just call me Marshall.
Outlaw #187
libre.fm/me
Maintainer of the Jezracorp Arch Linux packages
Image
User avatar
timttmy
Stockman
Stockman
 
Posts: 510
Joined: 28 Apr 2008, 20:09
Location: Cornwall, Uk
Distro: Arch Linux
Desktop: openbox with centbar
CLI Editor: nano
GUI Editor: geany

Re: Battery indicator for Openbox

Postby mjjzf on 11 Nov 2008, 19:16

Pypanel is just a generic panel with a systray.
As I understand it, you can not make an info tray icon with Batmon?
User avatar
mjjzf
Cutpurse
Cutpurse
 
Posts: 1624
Joined: 10 Aug 2008, 11:30
Location: Brooklyn, New York - USA
Distro: Slackware
Desktop: Xfce
CLI Editor: Vim
GUI Editor: Medit

Re: Battery indicator for Openbox

Postby mjjzf on 11 Nov 2008, 19:20

The thing is, in Xfce I use the genmon plugin to poll my battery script and output "x%" on the panel, as you can see here. Essentially, I just need an application which will dock into the systray and display the battery value, possibly on mouseover.
User avatar
mjjzf
Cutpurse
Cutpurse
 
Posts: 1624
Joined: 10 Aug 2008, 11:30
Location: Brooklyn, New York - USA
Distro: Slackware
Desktop: Xfce
CLI Editor: Vim
GUI Editor: Medit

Re: Battery indicator for Openbox

Postby timttmy on 11 Nov 2008, 20:31

puppy uses batmon in the panel on jwm. Maybe you could get some clues from there scripts here. http://www.murga-linux.com/puppy/viewtopic.php?t=12394.
Or maybe I'm missing something and it can't be done.
Timttmy. It's an unpronounceable user name. Just call me Marshall.
Outlaw #187
libre.fm/me
Maintainer of the Jezracorp Arch Linux packages
Image
User avatar
timttmy
Stockman
Stockman
 
Posts: 510
Joined: 28 Apr 2008, 20:09
Location: Cornwall, Uk
Distro: Arch Linux
Desktop: openbox with centbar
CLI Editor: nano
GUI Editor: geany

Re: Battery indicator for Openbox

Postby jezra on 12 Nov 2008, 01:53

Although not a panel applet, xbattbar might suit your needs. On a system running Openbox and fbpanel,I launch xbattbar from the .xinitrc with
Code: Select all
xbattbar-acpi -s 2 -p left -I "dark green" -O "black" &
This gives me a 2 pixel wide line on the left of my monitor that displays battery charge. Mousing over the line displays more information.
If the key is super, why is there a Windows logo on it?
What I've been doing
User avatar
jezra
Rogue
Rogue
 
Posts: 2505
Joined: 01 Jul 2008, 08:45
Location: http://www.openstreetmap.org/?lat=38.23212&lon=-122.63591&zoom=15
Distro: Arch, Ubuntu Server
Desktop: openbox dmenu
CLI Editor: nano
GUI Editor: geany,netbeans

Re: Battery indicator for Openbox

Postby mjjzf on 12 Nov 2008, 11:30

I seem to have some annoying compile errors. Maybe it is the classic libconfig vs. libconfig-debian issue.
User avatar
mjjzf
Cutpurse
Cutpurse
 
Posts: 1624
Joined: 10 Aug 2008, 11:30
Location: Brooklyn, New York - USA
Distro: Slackware
Desktop: Xfce
CLI Editor: Vim
GUI Editor: Medit

Re: Battery indicator for Openbox

Postby dpkgregor on 12 Nov 2008, 16:02

User avatar
dpkgregor
Stockman
Stockman
 
Posts: 718
Joined: 08 Jun 2008, 15:17
Location: Slovenia
Distro: Arch / Ubuntu
Desktop: GNOME / Fluxbox
CLI Editor: nano
GUI Editor: leafpad

Re: Battery indicator for Openbox

Postby mjjzf on 12 Nov 2008, 19:24

Noteo would be nice, if I could find out how to knock together the plugin.
User avatar
mjjzf
Cutpurse
Cutpurse
 
Posts: 1624
Joined: 10 Aug 2008, 11:30
Location: Brooklyn, New York - USA
Distro: Slackware
Desktop: Xfce
CLI Editor: Vim
GUI Editor: Medit

Re: Battery indicator for Openbox

Postby timttmy on 16 Nov 2008, 15:59

This thread got me thinking about the lack of a battery warning tool on the cli.
Would this do it? (running in the background ).
Code: Select all
#!/bin/bash
# /home/marshall/Documents/battery.sh A script to warn of battery faliure.

rc=`cat /proc/acpi/battery/BAT0/state | grep 'remaining capacity' | cut -c 26-28`

low=`cat /proc/acpi/battery/BAT0/info | grep 'design capacity low' | cut -c 26-28`

if [ $rc -lt $low ] ; then
   cat /home/marshall/crapalert.wav > /dev/dsp
else
   /home/marshall/Documents/battery.sh
fi


Anyone know a better way? I'm not happy with the else part, I haven't figured out while or sleep yet :) (don't laugh) :lol:
Timttmy. It's an unpronounceable user name. Just call me Marshall.
Outlaw #187
libre.fm/me
Maintainer of the Jezracorp Arch Linux packages
Image
User avatar
timttmy
Stockman
Stockman
 
Posts: 510
Joined: 28 Apr 2008, 20:09
Location: Cornwall, Uk
Distro: Arch Linux
Desktop: openbox with centbar
CLI Editor: nano
GUI Editor: geany

Next

Return to Archives

Who is online

Users browsing this forum: No registered users and 1 guest