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                                      [EMAIL PROTECTED]
-- 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.
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to