zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: prompt_clint and battery level with no battery
@ 2001-06-26 13:47 Clint Adams
  2001-06-26 15:28 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2001-06-26 13:47 UTC (permalink / raw)
  To: zsh-workers

On a system with /proc/apm that is not a laptop and thus has
no battery, my prompt has an unfortunate -1% in it.

I also think that the prompt system should behave more
harmoniously with user-defined precmd()s.

Index: Functions/Prompts/prompt_clint_setup
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Prompts/prompt_clint_setup,v
retrieving revision 1.1
diff -u -r1.1 prompt_clint_setup
--- Functions/Prompts/prompt_clint_setup	2001/05/27 05:03:11	1.1
+++ Functions/Prompts/prompt_clint_setup	2001/06/26 13:36:45
@@ -67,7 +67,7 @@
   local bat
 
   bat=${${="$(</proc/apm)"}[7]/%/%%}
-  [[ $bat == "100%" ]] && psvar[2]=() || psvar[2]=$bat
+  [[ $bat == ("100%"|"-1%") ]] && psvar[3]=() || psvar[2]=$bat
 }
 
 prompt_clint_setup "$@"


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

end of thread, other threads:[~2001-06-26 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-26 13:47 PATCH: prompt_clint and battery level with no battery Clint Adams
2001-06-26 15:28 ` Bart Schaefer

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