Coder Social home page Coder Social logo

fluxbox-battery-icon's Introduction

fluxbox-battery-icon

Fluxbox battery icon perl script by OTPABA

Licence: No licence found. Free to use. "Feel free to modify".

Author: OTPABA - http://forums.fedoraforum.org/member.php?u=193747

See http://forums.fedoraforum.org/showpost.php?s=ec087e478399a39882347f0fd6c77c39&p=1567472&postcount=8

Oignally copied from: http://forums.fedoraforum.org/attachment.php?attachmentid=22927&d=1333531555

Publishing message from OTPABA:


Hi all,

since Gnome v2 is not available any more by default, and my desktop must have 10 static workspaces (hard to change habits after 12 years) I switched to Fluxbox and obviously felt lack for some features. After my laptop died few times due to battery discharge I just spent few minutes to code a primitive but helpful status-bar battery icon. Works for me...

It is written in perl. It does not use native ACPI support. I simply used /usr/bin/acpi output instead (make sure you install acpi package before: yum install acpi). Icon will show you 100%, 75%, 50%, 25% changes. It turns full-red and starts blinking when battery is bellow 10%. When hovered you can see pop-up label like:

"Battery 0: Charging, 11%, 03:15:21 until charged"

It gets updated every 30 seconds. I used embedded / base64 encoded icon images to avoid dependencies. In my case I installed it under ~/scripts/baterryIcon.pl with 0755 (-rwxr-xr-x) permissions. It gets started by ~/.fluxbox/startup with a line:

~/scripts/baterryIcon.pl &

I'll be glad if you try it. I'll be happy if you like it Feel free to modify it if you need.

Generally it does not try to write anything to your system at all, so it should be safe to run, but please use it on your own risk and be aware of the following:

CAUTIONS:

  • never tested on systems others than Fedora 15;
  • never tested on a desktop computer without battery;
  • never tested on a laptop with more than one battery;
  • never tested on a different Window Manager than Fluxbox v1.3.2

Attached Files batteryIcon_v1.pl.gz (6.1 KB, 97 views)

Last edited by OTPABA; 4th April 2012 at 12:01 PM.


Tested on ubuntu 12.04 32bit / lenovo S10-2 netbook / lenovo X200s / Fluxbox 1.3.2

If acpi is not installed:

sudo apt-get install acpi

You may also need gtk2 perl bindings:

sudo apt-get install libgtk2-perl


fluxbox-battery-icon's People

Contributors

kwmiebach avatar

Stargazers

Amol Kolhe avatar

Watchers

miebach avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.