7

I've been trying to run through the .Xresources method, with no success (see comment here from a related question)

So what do I need to modify to make sure my Xmgrace window is of a particular size? When I run xmgrace myplot.agr it always ends up as a 680x700 window. I would like to set it to something different, as I always end up having to resize and click-scroll (Xmgrace does not like scroll-wheels).

Any thoughts or ideas most welcome.

Community
  • 1
  • 1
PyKa
  • 113
  • 1
  • 7
  • Hmm. Xresources are ancient, but should still work. Note that case is important, so if you entered Xmgrace in your Xresources file it won't work. – JvO Apr 26 '16 at 13:33
  • What would be the more current way of doing this? – PyKa Apr 26 '16 at 14:16
  • 1
    No idea... Some applications store the last know position of their window and restore that on start. You could try giving the window size directly on the command line: `xmgrace -geometry 1000x1000 myplot.agr` – JvO Apr 26 '16 at 15:49
  • This actually works... I've aliased `xmgrace` to `xmgrace -geometry 1050x750` as a workaround and have thus indirectly solved my problem. Thanks! – PyKa Apr 27 '16 at 09:36

1 Answers1

9

Per comments (and source), you could set the size and position of xmgrace in your $HOME/.Xdefaults file:

XMgrace*geometry: 1050x750

or (more specific)

XMgrace*mainWin.geometry: 1050x750

depending on how it uses the geometry resource during initialization.

The FAQ does not give more than a hint of the available resources, but is pretty clear that the classname is XMgrace. To get a complete list of resources, you'd have to read the source-code, which (for instance) in /src/xmgrace.c has

String fallbackResourcesHighRes[] = {
    "XMgrace*mainWin.width: 680",
    "XMgrace*mainWin.height: 700",
    "XMgrace*fontList:-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*",
    "XMgrace.consoleDialog*text.fontList:-*-courier-medium-r-normal-*-12-*-*-*->
    "XMgrace*HContainer.marginHeight: 3",
    "XMgrace*VContainer.marginHeight: 3",
    NULL
};

It decides to use that based on the screensize:

screen = DefaultScreenOfDisplay(disp);
if (HeightOfScreen(screen) < 740) {
    lowres = TRUE;
}

and (seeing no command-line arguments in the source) is configurable only using X resources. The -geometry option is a standard X toolkit option, used by other programs such as xterm.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105