Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-09-09 21:08:43

jdresme
Member
Registered: 2016-09-09
Posts: 2

Devilspie2 and Firefox inspector

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

#2 2016-09-09 23:59:55

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

Re: Devilspie2 and Firefox inspector

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

#3 2016-09-10 20:59:04

jdresme
Member
Registered: 2016-09-09
Posts: 2

Re: Devilspie2 and Firefox inspector

@ToZ: Thank you for your quick response.

However it maybe is not the most elegant solution, it does the job smile

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

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.019 seconds, 7 queries executed - Memory usage: 523.22 KiB (Peak: 529.31 KiB) ]