← Back to team overview

sslug-teknik team mailing list archive

Re: prompt + resterende batteri

 

On Sun, 24 Mar 2002, Kristian Kallenberg wrote:

> først hvor mange procent der er tilbage, så et procenttegn, og til sidst et 
> plus hvis vi kører på AC eller et minus hvis vi kkke gør!
> 
> hvordan er det lige jeg klarer den?

Hvis du bruger bash (hvad de fleste gør) kan du gøre noget i stil med

export PROMPT_COMMAND="PS1=\"[\u@\h \W \`cat /proc/apm | cut -d\" \" -f 7\` ]\$ \""
Det giver ikke din +/- - det må du selv ligge og rode med ;-)

[madsdyd@ripley madsdyd 95% ]$ export PROMPT_COMMAND="PS1=\"[\u@\h \W 
\`cat /proc/apm | cut -d\" \" -f 7\` ]\$ \""
[madsdyd@ripley madsdyd 95% ]$ echo $PROMPT_COMMAND
PS1="[\u@\h \W `cat /proc/apm | cut -d" " -f 7` ]$ "

Meget sjov lille ting, iøvrigt.

Mads

-- 
Mads Bondo Dydensborg.                               madsdyd@xxxxxxxxxxxx
The fact is that far more crime and child abuse has been committed by
zealots in the name of God, Jesus and Mohammed than has ever been committed
in the name of Satan. Many people don't like that statement, but few can
argue with it.
- Kenneth V. Lanning, Supervisory Special Agent at the Behavioral Science
Institution and Research Unit of the FBI Academy (from Carl Sagan's, The
Demon-Haunted World)




References