From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5861 invoked by alias); 26 Oct 2012 03:22:00 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17348 Received: (qmail 14473 invoked from network); 26 Oct 2012 03:21:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at velocitynet.com.au designates 203.17.154.25 as permitted sender) References: <50895F66.9050407@internecto.net> <20121025172732.56a44ed2@pwslap01u.europe.root.pri> <5089C812.6030504@eastlink.ca> Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: <7E27D744-D1CA-41FB-8B4E-4795209CA2E0@goldweb.com.au> Cc: Ray Andrews , "zsh-users@zsh.org" X-Mailer: iPad Mail (10A403) From: Alex Satrapa Subject: Re: volume label in prompt? Date: Fri, 26 Oct 2012 14:15:47 +1100 To: TJ Luoma I use this: precmd () { settitle "%n@m: %5(~:%-1~/=E2=80=A6/%3~:%~) } Where settitle is a function that sets my window title. The %X(A:B:C) constr= uct is zsh's ternary statement. What the above does is display paths with 1-= 3 elements whole, while longer paths have only the first and last three elem= ents with the remainder replaced by an ellipsis. If you use precmd you should be able to use any script you want to check the= mount table, gather the mounted volume's label, etc. Alex Satrapa On 26/10/2012, at 11:57, TJ Luoma wrote: > On Thu, Oct 25, 2012 at 7:15 PM, Ray Andrews wrot= e: >>=20 >> I'm now running three machines here, each with several copies of various >> linii available. It gets a bit confusing. I'm wondering if there might b= e >> something I can add to my prompt that could help me remind myself where I= 'm >> at. I'm open to any suggestions, but one idea I had was something to >> identify the volume label of the current root directory. That would do i= t >> if it can be done. Can it? >=20 > PROMPT=3D"%n@%m %~: " >=20 > n =3D username >=20 > m =3D hostname up to first "." >=20 > %~ is the current directory, using ~ for $HOME when appropriate.