Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
DEVILSPIE2LUA脚本,用于在指定位置打开所有bluej应用程序。_Lua_Bluej - Fatal编程技术网

DEVILSPIE2LUA脚本,用于在指定位置打开所有bluej应用程序。

DEVILSPIE2LUA脚本,用于在指定位置打开所有bluej应用程序。,lua,bluej,Lua,Bluej,我有一个.lua的魔鬼派2脚本,我正在努力工作。脚本的目的是强制所有bluej窗口在指定位置打开。我只能让主窗口在指定位置启动。从主bluej窗口中打开的所有其他bluej窗口都会忽略此规则。下面是脚本代码 --Start Bluej at specified position. if (get_application_name()=="bluej-Boot") then -- x,y-coordinates, xsize, ysize set_window_position(26

我有一个.lua的魔鬼派2脚本,我正在努力工作。脚本的目的是强制所有bluej窗口在指定位置打开。我只能让主窗口在指定位置启动。从主bluej窗口中打开的所有其他bluej窗口都会忽略此规则。下面是脚本代码

--Start Bluej at specified position. 
if (get_application_name()=="bluej-Boot") then
   -- x,y-coordinates, xsize, ysize
   set_window_position(2655,197);
end
这是devilspie2文档


正如您所看到的,我使用get_应用程序_名称来检查字符串literal bluej boot,这对主应用程序很有效。问题是从bluej中打开的窗口没有相同的应用程序名称。它将被重命名以匹配窗口名称。如何识别这些窗口并对其应用与主窗口相同的规则

在目标窗口打开时使用-d选项,cfg如下:

gwc=get_window_class()
gwt=get_window_type()
gan=get_application_name()
gcin=get_class_instance_name()

debug_print("Window name: " .. get_window_name());
debug_print("Application name: " .. gan);
debug_print("Window type: " .. gwt);
debug_print("Window role: " .. get_window_role());
debug_print("Window class: " .. gwc);
debug_print("Class instance: " .. gcin);
x, y, width, height = get_window_geometry();
debug_print("X: "..x..", Y: "..y..", width: "..width..", height: "..height);
debug_print("--------------------------------------------------")
并查看可以使用哪些字符串来选择它们