Subject: FVWM: Tab window switching more informative??

From: Yang Yang <[email-masked]>
Date: Mon, 9 May 2005 10:57:16 -0700

hi guys:
	I use Alt+tab in FVWM to switch between windows. the problem that
bothers me is that there is too little information showing in the
windowlist, for example, all xterm windows just show "xterm". so I do
not know which xterm window is the one I want to go to. it would be
more informative if the list also shows, for example, the working
directory, recent commands in that window, etc. 

	anybody knows how to do this? ( I do not want to use the "instant
snapshot" approach, cuz I'm too lazy to do the config, and it's
probably too slow for my machine .... )

	thanks a lot!

	Yang
--
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 Williams <[email-masked]>
Date: Mon, 09 May 2005 16:34:06 -0400

This solution is application-specific, but what i do is include the 
working directory in the xterm titlebar. And then do this separately for 
other applications in which i want more information, for instance.

.bashrc:

case $TERM in
     xterm*)
         TITLEBAR='\[\033]0;xterm:\w\007\]'
         ;;
     *)
         TITLEBAR=''
         ;;
esac
PS1="${TITLEBAR}\u@\h:\w\$ "

this sets the prompt to be user@host:directory
and the title to be xterm:directory

It is included in the PS1 variable, that way every time the prompt is 
printed the title bar is updated.

-Peter

---

From: jpkotta <[email-masked]>
Date: Thu, 12 May 2005 12:27:26 -0500

I have this in my .bashrc:

	# this makes the title of the terminal window 'user@host:  
/present/working/directory/'
	# see the Eterm technical docs, "Set X Terminal Parameters"
	# 'ESC ] 0 ; string BEL' sets icon name and title to string
	if [[ "$TERM" != "linux" ]] ; then
     		PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
	fi

Though it does the same thing, it doesn't use $PS1.  Theoretically, any  
command could generate the string, so you may be able to find a way to  
make it print out the command that you last executed.  I found this in the  
Eterm documentation, much of which applies to other terms:  
<http://www.eterm.org/docs/view.php?doc=ref>.

BTW, I did the whole snapshot window list thing.  You could probably just  
dump my config into a file, tweak it a bit, and do a Read on it.  I posted  
it on the FVWM forum here: <http://fvwm.lair.be/viewtopic.php?t=349>.

jpkotta

On Mon, 09 May 2005 15:34:06 -0500, Peter Williams <[email-masked]>  
wrote:

>> directory, recent commands in that window, etc.  	anybody knows how to  
>> do this? ( I do not want to use the "instant

---

From: Cameron Simpson <[email-masked]>
Date: Sat, 14 May 2005 16:28:59 +1000

On 12May2005 12:27, jpkotta <[email-masked]> wrote:
| Theoretically, any  
| command could generate the string, so you may be able to find a way to  
| make it print out the command that you last executed.

Indeed. Look at my windowlist:

	http://www.cskk.ezoshosting.com/cs/fvwm/windowlist-20050514.png

The zoob lines are terminals, on the host zoob, in my home directory
(the "~"), running the command listed (or last ran the command
if <in-angle-brackets>).  The "E" is a vi edit window, editing
~/scripts/addif. And so forth.

I have a script ttylabel:

	http://www.cskk.ezoshosting.com/cs/css/bin/ttylabel

to write the icon and title strings. I make them the same although
obviously they could be different (I don't use icons...)

In a zsh I invoke this from the preexec() and precmd() functions.
In a bash I set $PROMPT_COMMAND=atprompt, where atprompt is a shell function
that runs ttylabel amongst other stuff.

So tweak your shell environment. It will serve you well regardless of what
window manager you use.

Cheers,
--
Cameron Simpson <[email-masked]> DoD#743
http://www.cskk.ezoshosting.com/cs/

You can be psychotic and still be competent.
        - John L. Young, American Academy of Psychiatry and the Law on Ted
          Kaczynski, and probably most internet users
--
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: Cameron Simpson <[email-masked]>
Date: Sat, 14 May 2005 18:40:15 +1000

On 14May2005 01:19, Yang Yang <[email-masked]> wrote:
| 	could you tell me how to obtain the command history local to a
| single xterm? ----- if I do "history", the results from all xterms are
| the same

Sounds like you're using bash. It shares history across all shells.
However, the command "history 1", when used by the function called from
$PROMPT_COMMAND, should contain the last command executed for _that_
shell. Which would suffice:

	atprompt()
	{
	  ttylabel "$HOST $PWD <`history 1`>"
	}

Cheers,

When I die, I want to go sleeping like my grandfather...
Not screaming like the passengers in his car.   - [email-masked]
--
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: Cameron Simpson <[email-masked]>
Date: Sat, 14 May 2005 18:55:48 +1000

On 14May2005 18:40, I wrote:
| On 14May2005 01:19, Yang Yang <[email-masked]> wrote:
| | 	could you tell me how to obtain the command history local to a
| | single xterm? ----- if I do "history", the results from all xterms are
| | the same
| 
| Sounds like you're using bash.

Also, you should look at the $BASH_COMMAND variable.
-- 
Cameron Simpson <[email-masked]> DoD#743
http://www.cskk.ezoshosting.com/cs/

When a man rides a Motorader he stays forever young.    - German saying