Mailing List Archive

Support open source code!


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

Re: tlug: Changing title in kterm




On 13-Dec-98 Stephen J. Turnbull wrote:
> Evidently xtitle is an external program not provided by
> TurboLinux (which is why I don't have any documentation).

AHA! success (at least for me, YMMV) in .bash_profile

-------start---------------------------------------------------
# This function sets the xterm title to be the argument of xtitle
#  It is used below so that 'cd' will write the current directory
#  to the xterm title (see November #7  Linux Gazette for
#  explanation  of  the escape sequences, and how to insert them)
xtitle()
{
    if [ "$*" != "" ]; then
       echo -n "]0;$* "
    else
       echo -n "]0;xterminal:`/usr/bin/tty`"
    fi
}

# Only write to xterm if X is running
if [ "$DISPLAY" ]; then

   # Assign the titles of any xterms started in ~/.xinitrc
   xtitle $PWD
   
   temp_cd()
   {
       cd $1
       # Set the xterm title
       xtitle $PWD
       # Echo to screen, if you like
       echo $PWD
  }
else 
   temp_cd()
   {
       cd $1
       # Cannot write to xterm, just echo to screen
       echo $PWD
   }
fi
alias cd='temp_cd'    

-----------end--------------------------------------

Regards,

Jim S.

----------------------------------
email: jims@example.com
http://tlug.linux.or.jp/~jims/
----------------------------------
------------------------------------------------------------------
Next Nomikai: 15 January 1999, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Technical Meeting: 13 February, 12:30               Place: TBD
------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links