[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Set title bar name



On Tue, Mar 16, 2004 at 04:59:45PM -0800, Bill Moseley <moseley@hank.org> wrote:
> ...  Is there a program to set
> the title bar name that I can use as a wrapper script for nano -- set it
> to the file I'm editing, start nano, then on exit reset to "xterm".

Here's a shell script I've been using to set the window title...

    $ cat `which title`
    #!/bin/sh
    # 27jul99 kci, 07feb2000, by Ken Irving <jkirving@acsalaska.net>
    
    if [ "$1" == "-h" ]; then # online help message
        echo \
    ' Set X terminal title bar
     Usage:
         $ title any text   ... specify a title
         $ title            ... use/restore the default title
     Export the TITLE shell variable for the default title, e.g,:
         $ export TITLE=...; title'
        exit
    fi
    
    if [ $# -eq 0 ]; then
        if [ -z "$TITLE" ]; then
            TITLE='no title (see title -h)'
        fi
        echo -ne "\033]0;${TITLE}\007"
        exit
    fi
    
    echo -ne "\033]0;${TITLE}$@\007"

-- 
Ken Irving, Research Analyst, fnkci@uaf.edu, 907-474-6152
Water and Environmental Research Center
Institute of Northern Engineering
University of Alaska, Fairbanks



Reply to: