Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2012 07:31:08 +0200
From:      Lars Engels <lars.engels@0x20.net>
To:        Erich Dollansky <erichfreebsdlist@ovitrap.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Script to monitor battery status on X220
Message-ID:  <20120720053108.GD70259@e-new.0x20.net>
In-Reply-To: <201207201004.59451.erichfreebsdlist@ovitrap.com>
References:  <201207201004.59451.erichfreebsdlist@ovitrap.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--afaOoWBOIwPZGAW2
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jul 20, 2012 at 10:04:59AM +0700, Erich Dollansky wrote:
> Hi,
>=20
> I forget yesterday to share these two scripts:
>=20
> http://www.alogreentechnologies.com/freebsd/checkbattery
>=20
> checks the battery status of an X220 and shuts the machine down when the =
battery falls to 2% or below.
>=20
> The status is checked every minute.
>=20
> It calls the following script to shut the machine down:
>=20
> http://www.alogreentechnologies.com/freebsd/poweroff
>=20
> You must run the first script as root to enable it to power the machine o=
ff at the end.
>=20
> I found that the battery life of my machine was higher using a simple win=
dow manager like blackbox compared to things like GNOME or KDE. This might =
depend on the usage pattern.
>=20
> Erich

Is it necessary to poll? Usually devd generates an event when the
battery status and/or percentage changes. Just read the events from
/var/run/devd.pipe.

--afaOoWBOIwPZGAW2
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlAI7RwACgkQKc512sD3afipaACfUOnOt7kxYKArxvwpepPUebHD
x+oAn0Fi+VWgHjuvGiBYBzaz3X9NXiWP
=hxJF
-----END PGP SIGNATURE-----

--afaOoWBOIwPZGAW2--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120720053108.GD70259>