9

I'm using Mint 18.1 cinnamon. I'm trying to write a little bash program to move windows around.

I have a command that will remove maximized_vert and maximized_horz then move the window. It works fine if the the target window is maximized or just floating, but if the window is snapped into place using super [arrow] ( think this is tiling? ) it has no affect. The code is as follows

    wmctrl -r "$CHROME" -i -b remove,maximized_vert
    wmctrl -r "$CHROME" -i -b remove,maximized_horz
    wmctrl -r "$CHROME" -i -e '0,0,0,500,500'

Where "$CHROME" is the hex address or the window.

I repeat it works if the window is maxamized or if it is just floating but does not work when the window is tiled or snapped using super [arrow]

Thanks for the help

3
  • Very likely your window manager (whatever WM you are using) prevents it from moving if it's snapped or tiled, so you have do undo this state first. Commented Mar 23, 2017 at 7:15
  • Yea, I'm finding that the wm for cinnamon ( wmctrl ) is wildly inconsistent. I feel I will not be able to program against it. If you know of a ubuntu or mint flavor that has a WM that doesn't suck I'd love to hear about it. Commented Mar 23, 2017 at 13:36
  • In principle, you should be able to freely switch to whatever WM you like, though it probably won't work well together with the rest of your desktop. No need to change your complete distro. Wikipedia lists a few dozen WMs. I have a personal opinion about which WMs don't suck and which do, but that will probably doesn't much your opinion about which WMs don't suck. :-) Commented Mar 23, 2017 at 14:04

2 Answers 2

6

After playing around with this, I have a hack that works. Just add the maximized_vert or maximized_horz property to the window. Even if it already has the property, this will break tiling and will allow you to move the window position using wmctrl from there.

Silly, but it works.

1
  • 1
    Heh, that works with Kwin. I add it and then remove it. It does look a bit messy when animated though. Commented Jun 30, 2020 at 2:51
0

Seems also removing fullscreen is needed to play safe:

wmctrl -r "$CHROME" -i -b remove,fullscreen,maximized_vert,maximized_horz

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.