I'm trying to launch xcalc from the command line, in my embedded Unix, and I would like it to start centered on the screen, is there a way?

By the way, I'm using WindowMaker, if it makes any difference..


You can usually add a -geometry argument to specify the size a window should be from the command line, but WHERE it gets placed is up to the window manager. The program itself can request this but usually there are not command line argument for where to send it. You can fetch the window ID and use another X utility to request a placement, or you can teach your window manager to recognize that window and place it at a given location. Window managers reserve the right to place things wherever they feel like, the things the programs ask for are only used as hints.

  • +1 Thanks for the informations. Yes, I'm looking for some WindowMaker property to always open windows on the center of the screen, but I still found nothing.. – Tom Brito Jul 1 '11 at 14:08
  • 1
    @Caleb: it is spelled -geometry (with single dash) I think. Also, it appears that with this flag you may not only set the window size, but it's position also: tldp.org/HOWTO/XWindow-User-HOWTO/cli.html (how easy it is to calculate when you don't know the window size in advance is another question) – alex Jul 1 '11 at 15:05
  • @alex: Good catch. Don't hesitate to suggest edits for little things you see could be fixed, esp like that that would throw an error :) – Caleb Jul 1 '11 at 15:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.