我得到了一个devilspie2的.lua脚本,我正试着让它开始工作。脚本的目的是强制所有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文档。Devilspie2
正如您所看到的,我使用get_application_name()来检查字符串文字"bluej-boot“,这对于主应用程序很有效。问题是在bluej中打开的窗口不具有相同的应用程序名称。它将被重命名以匹配窗口名称。如何识别这些窗口,并对它们应用与主窗口相同的规则?
发布于 2014-09-18 11:07:01
在目标窗口打开时使用"-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("--------------------------------------------------")并查看可以使用哪些字符串来选择它们。
https://stackoverflow.com/questions/23585196
复制相似问题