4

I am running Linux Mint 13, with a KDE 4 desktop manager. I would like to launch applications from a terminal (konsole in my specific case) and setting the exact size of the window and the location of the window. As an example, if I launch Kate and Chromium from a terminal, I want Kate's window the cover the left-half of my screen and I want Chromium to cover the upper-right quarter of my screen.

How can I accomplish this?

ps: I have a 15.6" screen set to a 1920x1080 resolution.

  • 2
    For some applications: you may use -geometry WIDTHxHEIGHT+X+Y – ninjalj Oct 8 '13 at 16:15
  • 1
    This link explains the comment above but only some applications accept -geometry. Also, some apps don't use pixels but columns and rows. – user15760 Oct 8 '13 at 16:20
  • 1
    If -geometry isn't giving you the result you want, try wmctrl. chromium && wmctrl -r chomium -e 'g,x,y,w,h' You might need a sleep delay before wmctrl. Its a bit more complicated to figure out which chromium window to control when you have multiple open. – kalhartt Oct 8 '13 at 18:26
  • With -geometry you can also leave off width and height. You can also use negative numbers to offset from the right-hand and bottom edges of the screen. – kurtm Oct 8 '13 at 22:14
  • Maybe I am using it wrong but wmctrl did not work for me. I will play around with it some more in the weekend. – Aeronaelius Oct 10 '13 at 11:45
3

If you don't want to specify the geometry/position during startup, but permanently, simple use Kwin's rule system:

  • Launch the desired application
  • Right-click on the title-bar or use Alt+F3
  • More Actions
  • Special Window Settings
  • Tab: Window matching
    • Check, whether the values were detected correctly, otherwise use the Detect Windows Properties button to capture the data of the target window
  • Tab: "Size & Position"
    • Enable the checkboxes of Position and Size
    • Select, when to apply the Position/Size (Apply Initially, Force, etc.)
    • Set the value for Position and/or Size

You can do way more than just this using the window rules, see also: Screenshot of window specific settings in kwin.

  • I managed to get this working with some programs, however some others have quite random behaviour. Some times it works some times it doesn't. – Aeronaelius Oct 10 '13 at 11:44

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.