Subject: FVWM: Current directory in xterm title bar

From: Russell <[email-masked]>
Date: Mon, 21 Oct 2002 23:46:08 +1000

Hi all,

In .fvwm2rc, when an xterm is opened from a
pop-up menu, i want to show the current
directory in the xterm title bar. How can i
do that?
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Peter McAlpine <[email-masked]>
Date: Mon, 21 Oct 2002 09:56:47 -0500

hi,

google "I feel lucky" comes through again:

http://linuxselfhelp.com/HOWTO/Bash-Prompt-HOWTO/xterm-title-bar-manipulations.html

-peter

-- 
Peter McAlpine
[email-masked]

---

From: Russell <[email-masked]>
Date: Tue, 22 Oct 2002 01:11:35 +1000

Thanks all, i didn't know there were howtos
for such trivial things;)

In .bash_profile/.bashrc put:

case $TERM in
xterm* )
  PROMPT_COMMAND='echo -ne "\033]0;${PWD}\007"' ;;
* ) ;;
esac

---

From: Andy Arbon <[email-masked]>
Date: Mon, 21 Oct 2002 18:32:26 +0100

Hello,

This is a section from my .bashrc:
(excuse messy code - it's one of those 'under constant tweaking' things)

-------------------
function lastcommand() {
     TEST=`history 2 2>&1|tail -n1|sed -e "s/\ *[0-9]*\ *//"`
     TEST2="(`whoami`@`hostname|cut -d'.' -f1`): $TEST"
     echo -n "$TEST2 [`pwd`]"
     return;
}

export PROMPT_COMMAND='echo -en "\033]0;`lastcommand`\007"';
===============

This gives you a title bar that updates after each command is executed
and shows :
(<username>@<hostname>): <last executed command> [<current directory]

Looks like it should be a mess, but it's actually perfectly usable and
makes finding the correct xterm in the windowlist much easier.

If you make any useful improvements to the idea I'd be interested to
know about them.

Cheers,

Andy

-- 
Real Men don't make backups. They upload it via ftp and let the world
mirror it. -- Linus Torvalds

---

From: Richard Lister <[email-masked]>
Date: Mon, 21 Oct 2002 15:13:56 -0400 (EDT)

> From: Russell <[email-masked]>
> Subject: Re: FVWM: Current directory in xterm title bar
> Date: Tue, 22 Oct 2002 01:11:35 +1000
>

http://cns.georgetown.edu/~ric/howto/Xterm-Title/

:-)

Ric

---

From: Denis Perelyubskiy <[email-masked]>
Date: Mon, 21 Oct 2002 15:26:11 -0700

Andy,

How interesting. I was trying to do a lastcommand thing at
some point. But I could come up with nothing better then
sync my history with current and then parse that. But your
solution seems like it'd be much faster as it doe snot sync
the history...

Is this slow, or does it work well? If so, I'll steal this
from you :-)

thanks.

denis

  >(excuse messy code - it's one of those 'under constant tweaking' things)

denis

-- 
// mailto: Denis Perelyubskiy <[email-masked]>
// icq   : 12359698
// PGP   : http://www.cs.ucla.edu/~denisp/files/pgp.asc
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Russell <[email-masked]>
Date: Tue, 22 Oct 2002 11:05:21 +1000

> (excuse messy code - it's one of those 'under constant tweaking' things)

Prompt strings can also contain cursor movement commands.
You could have an extra prompt string displayed at the top or bottom
of the window, even without using the border. Browsing with google,
i think i've seen that kind of thing, and the background colour of
these strings can be changed which makes it look better.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Andy Arbon <[email-masked]>
Date: Tue, 22 Oct 2002 02:11:17 +0100

Denis Perelyubskiy wrote:
| Andy,
|
| How interesting. I was trying to do a lastcommand thing at
| some point. But I could come up with nothing better then
| sync my history with current and then parse that. But your
| solution seems like it'd be much faster as it doe snot sync
| the history...
|
| Is this slow, or does it work well? If so, I'll steal this
| from you :-)

Hey,

Logic dictates that there must be a performance penalty involved in
using this function as opposed to not using it, but on my 1Ghz Duron
there is no noticable effect at all. I expect there are more efficient
ways to do some of the things I'm doing if it were really necessary.

If you are going to use it, you might want to put an 'if' around the
export to stop the PROMPTCMD getting set when you're in a normal console
(ie, not an xterm), otherwise you end up with a line of crap getting
printed before your prompt.

Steal away ;)

Cheers,

Andy

|
| thanks.
|
| denis

- --