zsh-users
 help / color / mirror / code / Atom feed
* get output of a command in prompt
@ 2006-09-16 18:49 arno.
  2006-09-16 19:01 ` Frank Terbeck
  2006-09-17 17:22 ` Phil Pennock
  0 siblings, 2 replies; 7+ messages in thread
From: arno. @ 2006-09-16 18:49 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

Hi,
I want to get the output of a command in my prompt 
(actually, I want the temperature of my cpu in RPS1 if it is superior 
to a some predifined value).
So I have something like :
 RPS1="%2v"
 and 

precmd() {
    gettemp
}

with gettemp that gets temperature and puts it in psvar[2] if needed.

Today, I've seen in zsh user guide :

> Some people make the mistake of using it [precmd function] to set up a 
> prompt, but there are enough ways of getting varying information into a 
> fixed prompt string that you shouldn't do that unless you have very odd 
> things in your prompt.
http://zsh.sunsite.dk/Guide/zshguide03.html#l51

But I didn't find a better way to do what I want. Did I miss something, 
or is my goal something "very odd".

thanks 
arno

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-09-17 17:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-16 18:49 get output of a command in prompt arno.
2006-09-16 19:01 ` Frank Terbeck
2006-09-17 14:14   ` arno.
2006-09-17 16:58     ` Bart Schaefer
2006-09-17 17:09     ` Dan Nelson
2006-09-17 17:24       ` arno.
2006-09-17 17:22 ` Phil Pennock

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