This site is now 100% read-only, and retired.

Differentiating xterms

Posted by yaarg on Wed 2 Mar 2005 at 05:11

Tags:

You've probably come across the problem in which you have several xterms open in your window manager - and you can't tell which is which when they are out of view!

To counter this problem, I have several scripts in my ~/bin like music, irc etc that basically set the title of the xterm (using xtermset -title and runs the corresponding app.

It's a little thing that I've found has made a huge difference in usability of my computer,..

 

 


RSS
Posted by Anonymous (68.110.xx.xx) on Thu 3 Mar 2005 at 14:28
FYI - This article is popping up about 60 times in my RSS reader (Akregator).

[ Parent ]

Re: RSS
Posted by Steve (82.41.xx.xx) on Fri 4 Mar 2005 at 11:03
[ View Weblogs ]

Best report it as a bug in your reader then - the feeds on this site both seem OK. One entry for this article, and for each of the previous ten.

Steve
-- Steve.org.uk

[ Parent ]

Re: Differentiating xterms
Posted by Anonymous (62.4.xx.xx) on Mon 14 Mar 2005 at 10:07
Hi,
This tips suck ;0)
It's mutch better to dynamicly change the xterm title with echo.
Put this line in your zshrc :

ZSH :
precmd()
{
case $TERM in
xterm*)
echo -ne "\033]0;${USER}@${HOST%%.*}:${PWD/$HOME/~}\007"
;;
screen)
echo -ne "\033_${USER}@${HOST%%.*}:${PWD/$HOME/~}\033\\"
;;
esac
}

You will get a nice title like that : user@hostname:path

Best Regards

[ Parent ]

Re: Differentiating xterms
Posted by yaarg (81.178.xx.xx) on Mon 14 Mar 2005 at 11:23
[ View Weblogs ]
Bash is setup on Debian to do that by default but it doesn't help *me* much. Let me demostrate with a screenshot. Now, how can I possibly tell that mutt is in one window, irc in another etc? The user@path title doesn't really help much!

I've tried setting it up to set the title to the current command being executed but could only get it to set the title to the last command...I might try again soon.

[ Parent ]

Re: Differentiating xterms
Posted by yaarg (81.178.xx.xx) on Mon 14 Mar 2005 at 11:32
[ View Weblogs ]
I've put up a screenshot to contrast with the above now also.

I should mention the window manager is the ever wonderful Ion 3.

[ Parent ]

Re: Differentiating xterms
Posted by Anonymous (150.216.xx.xx) on Mon 21 Mar 2005 at 14:25
Continuing the assumption that we all use ZSH, I suggest that you seek inspiration on zshwiki.org.

[ Parent ]

Re: Differentiating xterms
Posted by midget (80.202.xx.xx) on Wed 27 Apr 2005 at 17:08
For those of you using irssi - this script gives you a title on the top of your *term :) Any solution for those of us who use bash?

[ Parent ]

Re: Differentiating xterms
Posted by Anonymous (66.92.xx.xx) on Wed 27 Apr 2005 at 18:00
This is, after all, about differentiating xterms: so use the capabilities of your xterm. Even basic xterm can use different text and background colors: I find the combinations
black on white and white, yellow, green, amber on black to all be highly readable. That gives 5 different kinds of terminals. In combination with virtual desktops, I rarely need more than that to quickly decide what window I want to focus on.

Using aterm or any of the other advanced xterms, you can also set transparency and color tinting. Adding a simple transparent term and tints of red, green, blue and yellow gives 5 more terminal types.

I pick a nice, large, clear monospaced font and use it in all my terms. I also keep the geometry constant -- I find that with a 1600x1200 screen, lucidasanstypewriter-18 is eminently readable, especially with an 80x37 window.

[ Parent ]

Re: Differentiating xterms
Posted by GoodTimes (65.247.xx.xx) on Thu 12 May 2005 at 19:13
[ View Weblogs ]
I use this

export PROMPT_COMMAND=echo -ne "\033]0;${WINDOW_TITLE} ${USER}@${HOSTNAME%%.*}:${PWD}\007"

but GoodTimes, what is the WINDOW_TITLE variable

Well, like has been mentioned, xtermset or some othe such command will set the title of your xterm

but a long time ago, i used some distribution that had the command

settitle

and since i don't have that now on my Debian system, I setup a function that allows me to set the title

function settitle {
WINDOW_TITLE="$@"
echo -e "\033]0;$@\007"
}


so with these two things, i end up having the user@host bit, but a title I can set that appears first. This makes it so that if you are doing xterms (putty) on windows, that when you alt+tab you see the titles, and when you look at the task bar, you'll see the first part of the title, which should be what was set by settitle.


[ Parent ]