[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devilspie2-discuss] strting a window maximized and unfocused

From: Tomáš Hnyk
Subject: Re: [Devilspie2-discuss] strting a window maximized and unfocused
Date: Sat, 02 Aug 2014 18:18:29 +0200
User-agent: Opera Mail/12.16 (Linux)

Ok, so I found a way to do this:

if (get_application_name()=="foo") then
os.execute("wmctrl -i -r " .. get_window_xid() .. " -e 1,3882,1112,-1,-1") os.execute("wmctrl -i -r " .. get_window_xid() .. " -b add,maximized_vert,maximized_horz")

First line starts the window minimized, second puts it to viewport 3,2 and the third maximizes it without focusing it. It is a bit cumbersome but works. The window seems to blink for a few millisecond when it is being started, but it really just flashes.

Also, as per putting a window to selected viewport, one just needs to do some calculations. In Compiz, the screen is one workspace, so if X and Y are the horizontal and vertical sizes of display, to put a window to a vieport x,y (x is horizontal index and y vertical), one needs to put it at coordinates xX+launcher_size,yY+32 (32 being the size of unity panel, if I am not mistaken). this works both with wmctrl and devilspie2.

Any more elegant ways to do this are welcome.
Best Regards,

On Sat, 02 Aug 2014 16:48:16 +0200, Tomáš Hnyk <address@hidden> wrote:

I would like to start some windows unfocused, but maximized (on a
specified workspace). Is there a way to do this? It does not seem to be
straightforward. My idea would be to start the application minimized and
then use wmctrl to maximize it and move it to the workspace. But I am not
sure about a way to hook external commands to devilspie2 scripts. Can it be done?

Also, how does it work with viewports? I use Compiz on Ubuntu with Unity and I have 9 viewports in a 3x3 grid. When I use set_viewport(a); if a is 1-3, it works correctly, but for numbers above 3, it does not work as expected (it just opens the window on current workspace).

There is a typo here, I think, it should be "decorate" and not "docorate".

BTW: There does not seem to be much consistency in naming the fuctions - sometimes you get "window" in functions names and sometimes not. Like in "set_viewport" and "set_window_workspace()". It is not serious, but confused me when I first read the docs.
Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]