Zsh Mailing List Archive
Messages sorted by:
Re: To have cpu frequency or/and battery state percentage in my prompt
- X-seq: zsh-users 12016
- From: Atom Smasher <atom@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: To have cpu frequency or/and battery state percentage in my prompt
- Date: Mon, 15 Oct 2007 10:30:59 +1300 (NZDT)
- In-reply-to: <fetvt9$o91$1@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Openpgp: id=0xB88D52E4D9F57808; algo=1 (RSA); size=4096; url=http://atom.smasher.org/pgp.txt
- References: <fet5io$fg8$1@xxxxxxxxxxxxx> <20071014204722.76757.qmail@xxxxxxxxxxx> <fetvt9$o91$1@xxxxxxxxxxxxx>
On Sun, 14 Oct 2007, giggz wrote:
i've got this (in colors, depending on battery state and level of
charge) on FreeBSD 6.2 (acpi). if anyone wants details i'll post...
short version: root runs a cron job every minute to get the battery
state; this is written to a file in /tmp; the prompt looks for this
file; if it's there it becomes part of the prompt.
Yes please :)
the shell script is run by root every minute. the overhead is too high to
run it every precmd. if that script is not running (and thus not creating
the /tmp/battery-status file) ie; on my server, the battery status part of
the prompt is gracefully ignored.
the battery stuff is most likely freebsd specific (i haven't tested it on
anything else) but there's a lot of wild-n-crazy stuff in my zshrc that
can be "borrowed" for any system ;)
lemme know how it works out... and if anyone improves on anything there,
please share it...
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
"The seafood industry is literally plundering the ocean
of life and some fifty percent of fish caught from the
oceans is fed to cows, pigs, sheep, chickens etc in the
form of fish meal. It also takes about fifty fish
caught from the sea to raise one farm raised salmon."
-- Capt Paul Watson, A Very Inconvenient Truth
Messages sorted by: