[KyOSS Discuss] ZSH battery prompt

Jeff Squyres jeff at squyres.com
Wed Jun 18 09:56:56 EDT 2014

Thanks for the nudge, Chris.

I went and customized my prompt, stealing heavily from the sorin and steeef
themes.  Here's a screenshot, because otherwise the colors don't come

[image: Inline image 2]

I have a white background, so my requirement has for
high-contrast-with-white colors.  YMMV.

The 2-line main prompt has 5 characteristics:

   1. Current time.  Sometimes it's valuable to know (roughly) how many
   minutes a command took.
   2. Machine name.  I ssh to a lot of different machines (but I don't care
   too much about my specific username on that machine; I removed that from
   the steeef theme).  The all-caps name is what Cisco IT assigned to my
   laptop; I can't change it... sad panda...
   3. Current directory. I liked the sorin theme method of shortening
   intermediate directory names to 1 character -- it leaves the last name
   expanded so you can see exactly where you are, but still gives you a sense
   of "depth" away from your home directory.
   4. VCS info.  You can see three examples above showing that it seems to
   work nicely for SVN, Git, and Mercurial (all of which I use on a daily
   5. $ or # prompt.  steeef drove me crazy by not showing a different
   prompt when you su or sudo.

The one thing that still somewhat annoys me is the compinit prompt.  It
complains when I sudo because /Users/jsquyres/.zprezto are owned by
jsquyres, not root.

Does anyone have a workaround for that, perchance?

On Tue, Jun 17, 2014 at 10:17 AM, Chris Rockwell <chris at chrisrockwell.com>

> I'm messing around with configuring zsh this morning and I came across:
> http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/
> Nice that it includes battery life for laptop.
> Chris Rockwell
> _______________________________________________
> KyOSS-Discuss mailing list
> KyOSS-Discuss at kyoss.org
> Subscribe by sending email to kyoss-discuss-subscribe at kyoss.org
> Unsubscribe by sending email (from the address you wish to unsubscribe) to
> kyoss-discuss-unsubscribe at kyoss.org
> Difficulty unsubscribing? Check your email headers for originally-to
> address in case you are forwarding your mail.
> More options at http://kyoss.org/cgi-bin/mailman/listinfo/kyoss-discuss

{+} Jeff Squyres
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kyoss.org/pipermail/kyoss-discuss/attachments/20140618/401193f4/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jsquyres-zsh-prompt.png
Type: image/png
Size: 59540 bytes
Desc: not available
URL: <http://kyoss.org/pipermail/kyoss-discuss/attachments/20140618/401193f4/attachment-0001.png>

More information about the KyOSS-Discuss mailing list