Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: To have cpu frequency or/and battery state percentage in my prompt



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 :)
=====================

http://smasher.org/tmp/zshrc-and-battery-stuff.tgz

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...


--
        ...atom

 ________________________
 http://atom.smasher.org/
 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: Reverse Date, Date, Thread, Author