You are not logged in.
Pages: 1
I'm using devilspie2 to manage different application windows, with success. There is just one thing that does not work right: when I open the Inspector from Firefox by clicking "Inspect element (Q)" in the context menu.
The .lua file i use:
window_name = get_window_name();
i, j = string.find(window_name, "Inspector");
if (i ~= nil) then
set_window_geometry2(1726,24,1024,768);
-- x,y, xsize, ysize
end
This does not move the Inspector window when it opens, though when I restart devilspie2 it is moved to the expected geometry.
I tried to use the 'debug_print()' function: it shows 'Window Name: Unnamed Window', while the output from 'xprop' contains: WM_NAME(STRING) = "Inspector - Post new topic / Xfce Forums".
It seems that the window not immediately gets its name when it's started. Could anyone give a hint how to tackle this?
Offline
I don't believe devilspie watches for window name changes. How about matching on 2 items? The window name (Unamed Window) and the window class (Firefox)?
BTW, welcome the forums.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
@ToZ: Thank you for your quick response.
However it maybe is not the most elegant solution, it does the job
Because the Inspector window gets its name "Inspector" later on, I combined the two checks as follows so the window will get/keep its desired geometry also when gdevilspie is restarted while the window is active:
if ( get_window_class() == "Firefox" ) then
window_name = get_window_name()
i, j = string.find(window_name, "Inspector");
if ( window_name == "Unnamed Window" or i ~= nil ) then
set_window_geometry2(1726,24,1024,768);
-- x,y, xsize, ysize
end
end
Thanks for helping out!
Offline
Pages: 1
[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 523.22 KiB (Peak: 529.31 KiB) ]