From owner-freebsd-questions@FreeBSD.ORG Wed Aug 18 01:52:04 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7116816A4CE for ; Wed, 18 Aug 2004 01:52:03 +0000 (GMT) Received: from mtiwmhc11.worldnet.att.net (mtiwmhc11.worldnet.att.net [204.127.131.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BD8543D3F for ; Wed, 18 Aug 2004 01:52:03 +0000 (GMT) (envelope-from duanewinner@worldnet.att.net) Received: from [10.10.0.101] (pcp04355855pcs.glstrt01.nj.comcast.net[68.45.111.171]) by worldnet.att.net (mtiwmhc11) with ESMTP id <2004081801520211100bngele> (Authid: duanewinner); Wed, 18 Aug 2004 01:52:02 +0000 Message-ID: <4122B61B.1050608@att.net> Date: Tue, 17 Aug 2004 21:51:23 -0400 From: Duane Winner User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040809 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gary Kline References: <41222679.7080000@att.net> <4122351E.7040205@att.net> <20040817165757.GA88222@thought.org> In-Reply-To: <20040817165757.GA88222@thought.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: xtset or xtermset tricks? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2004 01:52:04 -0000 Gary Kline wrote: > On Tue, Aug 17, 2004 at 12:41:02PM -0400, Duane Winner wrote: > >>Found a solution! >> >>In ~/.bashrc, put this: >> >>cd () >>{ >> builtin cd "$@" >> /usr/local/bin/xtset %u@%h:`pwd` >>} >> >> >> >>-Duane >> >> >>Duane Winner wrote: >> >>>Hello, >>> >>>Hey, does anybody know of any useful tricks for automating xtset or >>>xtermset? >>> >>>I use xtset to set the title and icon labels to user@host:path so I can >>>keep track of my xterms littered all over my desktop (pretty frequent! :) >>> >>>But it sure would be nice to have them updated whenever I 'cd' to >>>another directory or 'su' to another user or 'ssh' to another host! >>> > > > [ ... ] > > > I've got a slight problem with having the host/directory/etc on the > title bar. It will help clear my zsh right-prompt, of course. > But how do you set the title bar *back* to the name of the xterm? > (My xterms are titled "Mail", "Net", "Hacking", "Scratch", and so > forth.) Is there a way of using xtset/xtermset to retrieve the > -n "Name"?? Hm, not sure. I just started with xtset myself this morning when I decided I was getting sick of having 10 xterm windows all over my lawn with the name 'xterm'. I never gave descriptive labels since I'm most often ssh'd into other boxes and am more interested in where I am. Maybe, depending on how you start each xterm (icon/shortcut), you could set a variable name (XTNAME="Mail") for each one, then run: # xtset `echo $XTNAME` But now, since I hammered out that little cd() function for .bashrc, I found another little problem: If I su to another user (for instance, "su - root"), the title changes as long as the other account has my the function in .bashrc, but when I exit, the title still has the old credentials (example: root@mybox:~) until I cd somewhere again. Sigh. Cheers, Duane > > thanks, > > gary > >