* To have cpu frequency or/and battery state percentage in my prompt
@ 2007-10-14 13:26 giggz
2007-10-14 16:02 ` Michael Hernandez
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: giggz @ 2007-10-14 13:26 UTC (permalink / raw)
To: zsh-users
Hi,
I search ideas to have a good prompt which display the cpu frequency
or/and the battery state in my zsh prompt.
So if you have ideas and examples which I can put in my zshrc...
Thx and Regards,
Guillaume
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 13:26 To have cpu frequency or/and battery state percentage in my prompt giggz
@ 2007-10-14 16:02 ` Michael Hernandez
2007-10-14 16:46 ` wgscott
2007-10-14 16:10 ` wgscott
2007-10-14 20:47 ` Atom Smasher
2 siblings, 1 reply; 8+ messages in thread
From: Michael Hernandez @ 2007-10-14 16:02 UTC (permalink / raw)
To: zsh-users
On Oct 14, 2007, at 9:26 AM, giggz wrote:
> Hi,
>
> I search ideas to have a good prompt which display the cpu frequency
> or/and the battery state in my zsh prompt.
>
> So if you have ideas and examples which I can put in my zshrc...
>
> Thx and Regards,
> Guillaume
>
What OS are you using? I have a mostly-working combination of scripts
that shows me battery percentage on my mac. Also if you look at the
clint prompt that is shipped with zsh there is some apm stuff in there.
--Mike H
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 13:26 To have cpu frequency or/and battery state percentage in my prompt giggz
2007-10-14 16:02 ` Michael Hernandez
@ 2007-10-14 16:10 ` wgscott
2007-10-14 20:47 ` Atom Smasher
2 siblings, 0 replies; 8+ messages in thread
From: wgscott @ 2007-10-14 16:10 UTC (permalink / raw)
To: giggz; +Cc: zsh-users
On Sun, 14 Oct 2007 15:26:39 +0200
giggz <giggzounet@gmail.com> wrote:
Hi,
I search ideas to have a good prompt which display the cpu frequency
or/and the battery state in my zsh prompt.
So if you have ideas and examples which I can put in my zshrc...
Thx and Regards,
Guillaume
What's your operating system? I think this stuff is highly OS-dependent. On Ubuntu Linux,
for example, I have /proc/acpi
On OSX, system_profiler yields a lot of information but is too sluggish.
system_profiler -detailLevel mini
might be good enough.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 16:02 ` Michael Hernandez
@ 2007-10-14 16:46 ` wgscott
2007-10-14 19:15 ` Michael Hernandez
0 siblings, 1 reply; 8+ messages in thread
From: wgscott @ 2007-10-14 16:46 UTC (permalink / raw)
To: Michael Hernandez; +Cc: zsh-users
On Sun, 14 Oct 2007 12:02:46 -0400
Michael Hernandez <sequethin@gmail.com> wrote:
On Oct 14, 2007, at 9:26 AM, giggz wrote:
> Hi,
>
> I search ideas to have a good prompt which display the cpu frequency
> or/and the battery state in my zsh prompt.
>
> So if you have ideas and examples which I can put in my zshrc...
>
> Thx and Regards,
> Guillaume
>
What OS are you using? I have a mostly-working combination of scripts
that shows me battery percentage on my mac. Also if you look at the
clint prompt that is shipped with zsh there is some apm stuff in there.
--Mike H
I just found this "battery" script of OS X that is even written in zsh!
http://www.mitt-eget.com/software/macosx/battery/battery
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 16:46 ` wgscott
@ 2007-10-14 19:15 ` Michael Hernandez
0 siblings, 0 replies; 8+ messages in thread
From: Michael Hernandez @ 2007-10-14 19:15 UTC (permalink / raw)
To: wgscott; +Cc: zsh-users
On Oct 14, 2007, at 12:46 PM, wgscott@chemistry.ucsc.edu wrote:
> On Sun, 14 Oct 2007 12:02:46 -0400
> Michael Hernandez <sequethin@gmail.com> wrote:
>
>
> On Oct 14, 2007, at 9:26 AM, giggz wrote:
>
>> Hi,
>>
>> I search ideas to have a good prompt which display the cpu frequency
>> or/and the battery state in my zsh prompt.
>>
>> So if you have ideas and examples which I can put in my zshrc...
>>
>> Thx and Regards,
>> Guillaume
>>
>
>
> What OS are you using? I have a mostly-working combination of
> scripts
> that shows me battery percentage on my mac. Also if you look
> at the
> clint prompt that is shipped with zsh there is some apm stuff
> in there.
>
>
> --Mike H
>
> I just found this "battery" script of OS X that is even written in
> zsh!
>
> http://www.mitt-eget.com/software/macosx/battery/battery
>
Yes I use that with my zsh prompt, I have code to use battery to pull
the percentage and then stick it on the right-hand-prompt. Also have
it change colors from green to yellow to red depending on the
percentage, and show whether or not I am plugged in (AC) or using
battery (DC). For example (hopefully Mail.app doesn't wrap it
horribly...
--INSERT-- :zsh-4.2.5: (Sun 10/14/2007 15:13 EDT)
<Mike@artemis:~>
:p2: %
*AC* (99.8%)
The --INSERT-- is from visual vi mode...
I'm hoping that with leopard things don't change so much that it
breaks my prompt :)
--Mike H
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 13:26 To have cpu frequency or/and battery state percentage in my prompt giggz
2007-10-14 16:02 ` Michael Hernandez
2007-10-14 16:10 ` wgscott
@ 2007-10-14 20:47 ` Atom Smasher
2007-10-14 20:55 ` giggz
2 siblings, 1 reply; 8+ messages in thread
From: Atom Smasher @ 2007-10-14 20:47 UTC (permalink / raw)
To: zsh-users
On Sun, 14 Oct 2007, giggz wrote:
> I search ideas to have a good prompt which display the cpu frequency
> or/and the battery state in my zsh prompt.
>
> So if you have ideas and examples which I can put in my zshrc...
=================
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.
--
...atom
________________________
http://atom.smasher.org/
762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
-------------------------------------------------
"The livestock sector is a major player [in climate
change], responsible for 18% of greenhouse gas
emissions measured in CO2 equivalent. This is a higher
share than transport."
-- Livestock's long shadow, 2006
UN report sponsored by WTO, EU, AS-AID, FAO, et al
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 20:47 ` Atom Smasher
@ 2007-10-14 20:55 ` giggz
2007-10-14 21:30 ` Atom Smasher
0 siblings, 1 reply; 8+ messages in thread
From: giggz @ 2007-10-14 20:55 UTC (permalink / raw)
To: zsh-users
Atom Smasher a écrit :
> On Sun, 14 Oct 2007, giggz wrote:
>
>> I search ideas to have a good prompt which display the cpu frequency
>> or/and the battery state in my zsh prompt.
>>
>> So if you have ideas and examples which I can put in my zshrc...
> =================
>
> 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 :)
Thx a lot
Guillaume
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: To have cpu frequency or/and battery state percentage in my prompt
2007-10-14 20:55 ` giggz
@ 2007-10-14 21:30 ` Atom Smasher
0 siblings, 0 replies; 8+ messages in thread
From: Atom Smasher @ 2007-10-14 21:30 UTC (permalink / raw)
To: zsh-users
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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-10-14 21:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-14 13:26 To have cpu frequency or/and battery state percentage in my prompt giggz
2007-10-14 16:02 ` Michael Hernandez
2007-10-14 16:46 ` wgscott
2007-10-14 19:15 ` Michael Hernandez
2007-10-14 16:10 ` wgscott
2007-10-14 20:47 ` Atom Smasher
2007-10-14 20:55 ` giggz
2007-10-14 21:30 ` Atom Smasher
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).