How to I set the default startup window size for an X11 application (such as xmgrace)
Asked Answered
I

1

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.

Information answered 26/4, 2016 at 11:53 Comment(4)
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.Duhon
What would be the more current way of doing this?Information
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.agrDuhon
This actually works... I've aliased xmgrace to xmgrace -geometry 1050x750 as a workaround and have thus indirectly solved my problem. Thanks!Information
B
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.

Bravar answered 28/4, 2016 at 8:33 Comment(1)
Thanks that's exactly what I was looking forInformation

© 2022 - 2024 — McMap. All rights reserved.