[GRASSLIST:3457] Re: Changing the title of a window

Glynn Clements glynn.clements at virgin.net
Fri Apr 5 18:34:31 EST 2002


Soil & Water Lab. wrote:

> I'd like to change the title of the monitor window, from the standard 
> "GRASS5.0.0pre3 - Monitor: x0"
> to a more explicit name, such as:
> "The map which is actually displayed",
> which would be more simple than trying to remember what is displayed where.
> 
> I already came across the trick to change the title of the console itself
> echo -e "\033]0;${Title}\007\c"
> but couldn't find the way to access the monitor windows.
> 
> Would you have any idea how to do it easily ? BTW, I'm running GRASS on a 
> linux box (Suse7.1, bash 2.04.0(1)).

There isn't a simple way to do it; the protocol which is used to
communicate with the monitor doesn't have a command to set the title.

To add this feature, you would have to modify the code; specifically

	src/display/devices/XDRIVER/XDRIVER24	(XDRIVER)
	src/display/devices/lib			(the generic display code)
	src/libes/raster			(the client-side I/O library)

Alternatively, you could write a program which finds the window, and
sets its WM_NAME property directly. E.g.

#!/bin/sh
monitor="$1"
title="$2"
id=`xwininfo -name "5.0.0pre3 - Monitor: $monitor" | sed -n 's/^.*Window id: \(0x[^ ]*\).*$/\1/p'`
xprop -id $id -set WM_NAME "$title"

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list