Differentiating xterms
Posted by yaarg on Wed 2 Mar 2005 at 05:11
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,..
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | 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 | Reply to this comment ]
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 | Reply to this comment ]
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 | Reply to this comment ]
I should mention the window manager is the ever wonderful Ion 3.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
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 | Reply to this comment ]
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 | Reply to this comment ]