Scripts for Laptops
using FvwmPerl

These FvwmPerl scripts use PerlTk's ProgressBar widget to display battery charge level, screen backlight brightness level, & audio volume level. At the top of each script are instructions how implement them. They are kinda rough & I will be putting updates here as I improve them. But hey, they work for me.


FvwmBatteryDisplay.pl

Uses these files
/proc/acpi/battery/BAT1/info
/proc/acpi/battery/BAT1/state
Updates every 10 minutes or via the "Refresh" menu command described in the file's comments.
Works on my Toshiba Satellite A135-S4427 laptop & my Acer Aspire One AO751H netbook.


FvwmBrightnessDisplay.pl.blue

Uses these files:
/sys/class/backlight/psb-bl/brightness
/sys/class/backlight/psb-bl/max_brightness
Works on my Acer Aspire One AO751H netbook.
	Remove the ".blue" to use it.
	


FvwmBrightnessDisplay.pl.reina

Uses Keith Packard's xbacklight command.
Works on my Toshiba Satellite A135-S4427 laptop.
	Remove the ".reina" to use it.
	


FvwmVolumeDisplay.pl

Uses ALSA's amixer command to control Master Playback Volume.
Works on my Toshiba Satellite A135-S4427 laptop & my Acer Aspire One AO751H netbook.

NOTES:

Requirements: If you didn't assimulate & synthesize the information presented above, realize that FVWM, FvwmPerl, Perl, PerlTk, are required. PerlTk is not included in any of the Linux distributions I've used, so download it from cpan.org & install it. Note my current version of Tk (Tk-804.031) includes Tk::ProgressBar; a prior version of Tk did not.

Prior to using these modules, execute them from a command line and note any error messages, which might be something like

  Battery information is not accessible...exiting.
  Brightness information is not accessible...exiting.
  /usr/bin/xbacklight not executable...exiting.
  /usr/bin/amixer not available...exiting.
will require resolution before they will operate properly.

I added the following line

  +  "Refresh All" SendToModule /home/bgeer/bin/Fvwm*Display.pl refresh
to a FVWM menu and a simple click causes them all to refresh.

Ok, I'm a diehard C programmer. I haven't imbibed the kool-aid that is C++. If you don't like the looks of my Perl code, well, tough - you got what you paid for.

Why FVWM?

My core-duo laptop & single-core atom netbook are not exactly state of the art faster-than-greased-lightning computers. I used Ubuntu for a few years, but such heavy environments require so much resource that they felt more & more sluggish with each new release. I use Slackware & FVWM on the desktops I build & they feel very responsive. So I booted my laptop & netbook from a Slackware flash drive & they felt a lot more responsive.

So I installed Slackware on them. Wow! They feel a lot faster. Feel. They may not be faster, but they feel that way.

The downside is Slackware doesn't necessarily cater to all the fancy features of laptop/netbook computers. I pretty much don't care about some of the fancy features, but I do like having an indicator of battery condition, convenient audio volume control, & lowering screen brightness helps battery life. Since Xorg pretty much recognizes hotkeys, I felt challenged to bind them to useful little programs to accomplish their intended purpose.

Hence these programs. As noted, they have some rough spots; i.e., no automated installer & not all errors handled sensibly. I hope to improve on them & will post updates here if/when I continue work on them.

Robert Geer <bgeer@xmission.com>
Last modified: Tue Mar 3 19:18:24 MST 2009