[GRASSLIST:5757] Add location name to GIS Manager window name and to shell prompt


Hi
Grass 6.0 is multisession and now it’s possible to open more locations but all windows and the prompt have the same name and it’s difficult to navigate between the windows.

It’s useful to change these rows:

lib/init/init.sh

row 625

  • echo “GRASS GRASS_VERSION_NUMBER > '” >> “$cshrc”
  • echo “GRASS GRASS_VERSION_NUMBER - $LOCATION_NAME > '” >> “$cshrc”

row 667

  • echo “PS1='GRASS GRASS_VERSION_NUMBER:\w > '” >> “$bashrc”
  • echo “PS1='GRASS GRASS_VERSION_NUMBER:\w - $LOCATION_NAME > '” >> “$bashrc”

display/d.m/d.m.tcl

row 205

proc Dm::_create_intro { } {

global dmpath

global GRASSVERSION

  • global location_name

variable max_prgindic

set top [toplevel .intro -relief raised -borderwidth 2]

wm withdraw $top

wm overrideredirect $top 1

set ximg [label $top.x -image [image create photo -file “$dmpath/intro.gif”] ]

set frame [frame $ximg.f -background white]

  • set lab1 [label $frame.lab1 -text “GRASS $GRASSVERSION GIS Manager” \
  • set lab1 [label $frame.lab1 -text “GRASS $GRASSVERSION GIS Manager - $location_name” \

row 846

proc main {argc argv} {

global auto_path

global GRASSVERSION

  • global location_name

wm withdraw .

  • wm title . [G_msg “GRASS $GRASSVERSION GIS Manager”]
  • wm title . [G_msg “GRASS $GRASSVERSION GIS Manager - $location_name”]

Also it’s useful to add the location name to x0 (x1,x2,etc.) monitor name in display/drivers/XDRIVER/XDRIVER24/Graph_Set.c

Bye


|| Lorenzo Moretti e-mail: lorenzo.moretti@bologna.enea.it
||/|/| ENEA prot/idr Web: http://wwwamb.bologna.enea.it/
|| | via Don Fiammelli, 2 FTP: ftp://ftpamb.bologna.enea.it/ (ris.)

________________________________________________________________________

On Mon, Feb 14, 2005 at 10:44:41AM +0100, Lorenzo Moretti wrote:

Hi
Grass 6.0 is multisession and now it's possible to open more
locations but all windows and the prompt have the same name and it's
difficult to navigate between the windows.

It's useful to change these rows:

lib/init/init.sh

row 625
- echo "GRASS GRASS_VERSION_NUMBER > '" >> "$cshrc"
+ echo "GRASS GRASS_VERSION_NUMBER - $LOCATION_NAME > '" >> "$cshrc"

row 667
- echo "PS1='GRASS GRASS_VERSION_NUMBER:\w > '" >> "$bashrc"
+ echo "PS1='GRASS GRASS_VERSION_NUMBER:\w - $LOCATION_NAME > '" >>
"$bashrc"

Then the prompt will become rather long, right?

display/d.m/d.m.tcl

row 205
proc Dm::_create_intro { } {
    global dmpath
    global GRASSVERSION
+ global location_name
    variable max_prgindic

    set top [toplevel .intro -relief raised -borderwidth 2]

    wm withdraw $top
    wm overrideredirect $top 1

    set ximg [label $top.x -image [image create photo -file
"$dmpath/intro.gif"] ]

    set frame [frame $ximg.f -background white]
- set lab1 [label $frame.lab1 -text "GRASS $GRASSVERSION GIS Manager" \
+ set lab1 [label $frame.lab1 -text "GRASS $GRASSVERSION GIS
Manager - $location_name" \

row 846
proc main {argc argv} {
    global auto_path
    global GRASSVERSION
+ global location_name

    wm withdraw .
- wm title . [G_msg "GRASS $GRASSVERSION GIS Manager"]
+ wm title . [G_msg "GRASS $GRASSVERSION GIS Manager - $location_name"]

This one I'll leave to Michael.

Also it's useful to add the location name to x0 (x1,x2,etc.) monitor
name in display/drivers/XDRIVER/XDRIVER24/Graph_Set.c

Done.

Markus

Hi Markus

On Mon, Feb 14, 2005 at 10:44:41AM +0100, Lorenzo Moretti wrote:

Hi
Grass 6.0 is multisession and now it's possible to open more
locations but all windows and the prompt have the same name and it's
difficult to navigate between the windows.

It's useful to change these rows:

lib/init/init.sh

row 625
- echo "GRASS GRASS_VERSION_NUMBER > '" >> "$cshrc"
+ echo "GRASS GRASS_VERSION_NUMBER - $LOCATION_NAME > '" >> "$cshrc"

row 667
- echo "PS1='GRASS GRASS_VERSION_NUMBER:\w > '" >> "$bashrc"
+ echo "PS1='GRASS GRASS_VERSION_NUMBER:\w - $LOCATION_NAME > '" >>
"$bashrc"

Then the prompt will become rather long, right?

Not too much. Example:

GRASS 6.0.cvs - spearfish57 >

Or if too much long an idea

G6cvs-spearfish57 >
G6000-spearfish57 >

It's important to see what is the location in Grass 6.

in daily work it's very useful because with Grass 6 is more easy to work with 2, 3 or more locations together and the shell has always the same name: this was not a problem in Grass 5.x with 1 location any time.

>

display/d.m/d.m.tcl

row 205
proc Dm::_create_intro { } {
     global dmpath
     global GRASSVERSION
+ global location_name
     variable max_prgindic

     set top [toplevel .intro -relief raised -borderwidth 2]

     wm withdraw $top
     wm overrideredirect $top 1

     set ximg [label $top.x -image [image create photo -file
"$dmpath/intro.gif"] ]

     set frame [frame $ximg.f -background white]
- set lab1 [label $frame.lab1 -text "GRASS $GRASSVERSION GIS Manager" \
+ set lab1 [label $frame.lab1 -text "GRASS $GRASSVERSION GIS
Manager - $location_name" \

row 846
proc main {argc argv} {
     global auto_path
     global GRASSVERSION
+ global location_name

     wm withdraw .
- wm title . [G_msg "GRASS $GRASSVERSION GIS Manager"]
+ wm title . [G_msg "GRASS $GRASSVERSION GIS Manager - $location_name"]

This one I'll leave to Michael.

Ok I'll send the changes to Michael

> Also it's useful to add the location name to x0 (x1,x2,etc.) monitor

name in display/drivers/XDRIVER/XDRIVER24/Graph_Set.c

Done.

Good, very useful

Markus

Bye and thanx

--
________________________________________________________________________
|| Lorenzo Moretti e-mail: lorenzo.moretti@bologna.enea.it ||/|/| ENEA prot/idr Web: http://wwwamb.bologna.enea.it/ || | via Don Fiammelli, 2 FTP: ftp://ftpamb.bologna.enea.it/ (ris.)
~~~~~~ 40128 BOLOGNA - ITALY Ph: +39-0516098086 Fax: +39-0516098131
________________________________________________________________________

On Tue, Mar 01, 2005 at 10:10:11AM +0100, Lorenzo Moretti wrote:

Hi Markus

>On Mon, Feb 14, 2005 at 10:44:41AM +0100, Lorenzo Moretti wrote:
>> Hi
>> Grass 6.0 is multisession and now it's possible to open more
>> locations but all windows and the prompt have the same name and it's
>> difficult to navigate between the windows.
>>
>> It's useful to change these rows:
>>
>> lib/init/init.sh
>>
>> row 625
>> - echo "GRASS GRASS_VERSION_NUMBER > '" >> "$cshrc"
>> + echo "GRASS GRASS_VERSION_NUMBER - $LOCATION_NAME > '" >> "$cshrc"
>>
>> row 667
>> - echo "PS1='GRASS GRASS_VERSION_NUMBER:\w > '" >> "$bashrc"
>> + echo "PS1='GRASS GRASS_VERSION_NUMBER:\w - $LOCATION_NAME > '" >>
>> "$bashrc"
>
>Then the prompt will become rather long, right?

Not too much. Example:

GRASS 6.0.cvs - spearfish57 >

Or if too much long an idea

G6cvs-spearfish57 >
G6000-spearfish57 >

It's important to see what is the location in Grass 6.
in daily work it's very useful because with Grass 6 is more easy to
work with 2, 3 or more locations together and the shell has always
the same name: this was not a problem in Grass 5.x with 1 location
any time.

I see. What about this:

GRASS 6.0.cvs(brdUTM33):~ >
              ^^^^^^^^
                     location

added to CVS.

Markus

PS: Please send diffs always as attachment, not inline.

> >> Grass 6.0 is multisession and now it's possible to open more
> >> locations but all windows and the prompt have the same name and
> >it's > difficult to navigate between the windows.
> >>
> >> It's useful to change these rows:
> >>
> >> lib/init/init.sh
> >>
> >> row 625
> >> - echo "GRASS GRASS_VERSION_NUMBER > '" >> "$cshrc"
> >> + echo "GRASS GRASS_VERSION_NUMBER - $LOCATION_NAME > '" >>
> >"$cshrc" >
> >> row 667
> >> - echo "PS1='GRASS GRASS_VERSION_NUMBER:\w > '" >> "$bashrc"
> >> + echo "PS1='GRASS GRASS_VERSION_NUMBER:\w - $LOCATION_NAME >
> >'" >> > "$bashrc"
> >
> >Then the prompt will become rather long, right?
>
> Not too much. Example:
>
> GRASS 6.0.cvs - spearfish57 >
>
> Or if too much long an idea
>
> G6cvs-spearfish57 >
> G6000-spearfish57 >
>
> It's important to see what is the location in Grass 6.
> in daily work it's very useful because with Grass 6 is more easy to
> work with 2, 3 or more locations together and the shell has always
> the same name: this was not a problem in Grass 5.x with 1 location
> any time.

I see. What about this:

GRASS 6.0.cvs(brdUTM33):~ >
              ^^^^^^^^
                     location

If you are going to do that, would it be more logical/possible to do

GRASS x.y.x(location:mapset):\W >

does this get updated when you use g.mapset to change
location/mapset/database? (like adding a MASK changes the prompt)

Personally I like simple & elegant:

GRASS 6:~ >

\W instead of \w uses just the top dir name, not the full path. You can
see where you are but with a much shorter prompt.

And so my ~/.grass.bashrc file includes the line
PS1="GRASS 6:\W > "

Hamish

Hi Markus

I see. What about this:

GRASS 6.0.cvs(brdUTM33):~ >
              ^^^^^^^^
                     location

added to CVS.

Markus

Ok for me. Mapset is less important now: it's a long name

PS: Please send diffs always as attachment, not inline.

Ok only an attachment.

Bye

--
________________________________________________________________________
|| Lorenzo Moretti e-mail: lorenzo.moretti@bologna.enea.it ||/|/| ENEA prot/idr Web: http://wwwamb.bologna.enea.it/ || | via Don Fiammelli, 2 FTP: ftp://ftpamb.bologna.enea.it/ (ris.)
~~~~~~ 40128 BOLOGNA - ITALY Ph: +39-0516098086 Fax: +39-0516098131
________________________________________________________________________