From owner-freebsd-questions@FreeBSD.ORG Mon Jan 14 10:29:19 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23AA16A468 for ; Mon, 14 Jan 2008 10:29:19 +0000 (UTC) (envelope-from dread@aceweb.com) Received: from smtp107.sbc.mail.mud.yahoo.com (smtp107.sbc.mail.mud.yahoo.com [68.142.198.206]) by mx1.freebsd.org (Postfix) with SMTP id 7086613C457 for ; Mon, 14 Jan 2008 10:29:19 +0000 (UTC) (envelope-from dread@aceweb.com) Received: (qmail 79913 invoked from network); 14 Jan 2008 10:02:37 -0000 Received: from unknown (HELO localhost) (donread@sbcglobal.net@68.92.118.237 with login) by smtp107.sbc.mail.mud.yahoo.com with SMTP; 14 Jan 2008 10:02:37 -0000 X-YMail-OSG: W0U1HDUVM1mJl4UlpqQEk8OcKeIIE6pPcYMzF7Wdr1tN5LiS7E3O5gavnNd3sb1Il2.HeadjKg-- Date: Mon, 14 Jan 2008 10:02:35 +0000 From: Don Read To: Matiss Message-ID: <20080114100235.1be0efa3@aceweb.com> In-Reply-To: <1200296141.478b10cd53c0f@www.inbox.lv> References: <1200296141.478b10cd53c0f@www.inbox.lv> X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Which environment variable? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2008 10:29:19 -0000 On Mon, 14 Jan 2008 09:35:41 +0200 Matiss said: > Is there such environment variable, which changes window title for > putty? I mean, MC is able to change it to working dir I think.. How > do I change that title to let's say server name for my shell? > > Thanks :) man xprop Or for the terminally lazy, cat xtitle #!/bin/sh # # gets/sets xterm title # me=`basename $0` usage="Usage : $me [pwd | new title ... ] ('pwd' sets it to the current directory)"; Adjective='Current' while [ $# -gt 0 ] do case "$1" in --help | -help | -h | -\?) echo; echo $usage; exit 0;; -*) echo "$me: Unrecognized switch: $1 ($me -help to show valid options)"; exit 1;; pwd) Adjective='New'; Title=`pwd`;; *) Adjective='New'; Title=$1; while [ $# -gt 1 ] do shift;Title="$Title $1"; done;; esac shift done if [ -n "$Title" ] then xprop -id $WINDOWID -set WM_NAME "$Title"; fi Title=`xprop -id $WINDOWID | grep WM_NAME | cut -d= -f2` echo $Adjective 'title :' $Title exit 0 -- Don Read dread@aceweb.com -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.