tek - dominating unknown parameters since '76

I realised that fbpanel didn't have a default battery monitor and I got sick of opening a shell and typing "acpi -V" all the time, well actually I am lazy and forgot and had a few Homer moments and lost bits of work. So I knocked up this script for fbpanel.

On Debian it requires libnotify-bin for the send-notify to work correctly and here is the battery icon. You will need to place both in a directory called "bin" in your home directory and make sure both the directory bin and the script are executable (chmod +x battery etc) and in your $PATH.

The fbpanel bit is added to ~/.fbpanel/default

Make sure you back it up first eh?

Plugin {
type = genmon
config {
Command = ~/bin/battery
PollingTime = 60
TextSize = xx-small
TextColor = white
}
}

Command is obviously a call to the script
PollingTime is how often it is run (in secs)
TextSize is obvious along with TextColor

You'll need to restart the panel so open a shell and:

killall fbpanel && fbpanel &

This will gracefully stop and restart the panel to a background job.

If you're using this on something other than a notebook then you'll have to mess with the coordinates of the notifications. I've set the script to notify on anything below 11% (it's adequate for me and keeps the script simple) feel free to adjust to your needs. In fact you can safely remove it if you just want to sit in the bottom right (default). I think the script is easy to understand but ask away if you don't get anything or indeed have a better way of doing it.

Spicing it up, of course you can add sound notifications to it, or if you're a festival user you can add something like:

echo "Battery Low"| festival --tts

if like me you've constantly got headphones in to the end of the notification. Beware if you've got a busy CPU you may end up with race conditions.

Known Issues: Incorrect string when less than 10% - might fix it but since 10% = 20mins on my battery I am not that fussed as I will have plugged the power in. If you decide to fix this that's up to you.

Add your comments below:

Required

Required

  CAPTCHA imageRequired (enter the six letters)

cloud

12th planet 16bit 16Bit 64-bit 80s 1984 2007 6280 Accessibility accessibility adult advert afgan ajax Alexis K A Made Up Sound ambient angry annoyed apache apple apps arch arcticmonkeys argh art article articles artlab attack awesome b3ta backgrounds banning bash bass battery bbc beagleboard beast bed bees big-brother bigbrother bind biowar black sun empire blog blogging blogs blogsphere bnp bob dylan Boer boneyard bookmarklets booze bot-net botnet bots boycott brain brain fart brightkite browsers bt buddist bugs builder bulger bunnies burial bush bye campaigners censor censorship checkin chelsea tractor Chernobyl chilcot childhood china closure cloud cloud player club cms coding coffee cold collie buddz colony collapse disorder community conspiracy cool copyright corrupt Cosmin TRG cpu cracker craving css cunts custom cyberwar d&b D1 dad dark arts darkstep datsik day DDoS death debian Deep Teknologi deftones design designer Desto development diamonds diy dog dogpile dogs domain Don Ross dragon dreams drm drones drugs.punk drum dub dubstep Ebaumsworld economy electronica electron microscope email emo en encryption end enquiry epic Eprom essex everything excellent exploit extradition F fail FaltyDL family Fantastic Mr Fox fastest gun fbpanel Feeling Good filters Firefox firefox fixes flash flies flu fluxbox fnm fog formats forums free freedom freelance friday frugal fsf fuck you funny furQ G1 gaza gdm geek generator george.carlin germs glitch gnome goa trance google Google google earth GoogleOS gravatar greasemonkey greek greenpeace hacked hacker hackers hah hain handset hangover hawkwind headers Helm help hindu history Holocaust horse the band hospital hosting hotlinkers house htaccess humour hype iceweasel idiot idiots ie ie6 ie7 ill images independence indie industry insane insurrection intranet ip ipaq iphone iptables iraq iraq war ireland israel japan javascript job Joy Orbison jquery justice kanotix kernel keywords KG800 king crimson Kingdom knoppix Kuedo labour lada lady lady would have been older lasers layar layout legal levi-strauss lfs LG LGChocolate LHC libnofity-bin lies lifestream Linux linux lions list live location Lohan london lyrics m4w mac macs malware man in the middle marketing Mark Instinct Mark Pritchard Martyn massive masters of war media meme micro Microsoft microsoft minimal mj12 moblog mod_rewrite Mosca moscow mossad mothership motorola mozilla mum music myspace mysql napm neil net neutrality network new year new_year Nina Simone nirvana NiT GriT nokia nokia6280 none northwest note nothing nuclear Numan office move oldest omg oops open web oracle oss outkast p2p palestine palm pants paperless office parties patches pathetic pearl jam perl phishing photos php php-gtk pics picture piercings pigs pioneer pirate plane planes plasticpeople pmwiki popstep postfix power hour preemptive preston privacy project promotion protest protests python qr qr codes question time quote r100 ranges rant ravens Razr rdf record record grooves redhat regex remembrance renegade resistence resources review right rising risingdragon rising dragon hosting rob dougan robots rocket war ror router Royal-T rss ruby Rude Kid rules russia sad santa sarge save scam scrabble screenshot script script kiddie Sduk sea shepherd security send-nofity SEO server seven deadly sins shambo shit showcase shutdown site skillz slashdot slaughter sleep Slugabed smart meters sms snow snow leopard Somme so what space spam spammers SPDY speakers spydrone ssh ssl Starkey statement steampunk strike students stuff stupid suck sucks sun sunday surname sync T-Mobile tablet tasks tattoo techno technorati tek tengine Terror Danjah terrorism testing the cure theme The Month in Dubstep the prodigy thinking thoughts tikiwiki tim berners-lee time tls topsecret torture toshiba touchbook town planners trade union training transparency tribe tunes twins twitter UAV ubuntu unix unpopulartruth uptime URI US usa USSR V3 v3 van vanishing varroa veneables vets viagra video voodoo voyager220v vulnerability waiting man wales war War WC3 weapons web web-app web-tribe web.slashes web 2.0 web2.0 webapps webmaster Web Standards wedding weed ween weird we kill sluts whales whaling whiskey wifi win3.11 win7 windows wokingham woo woody wordpress work wow wp WP wtf WWI xfce xfce.debian xhtml XI xmas xml xp your Ypres ytmnd.com yule zero-day