Good one here :
Inspired from it, I have made this one :
if (get_window_type() ~= "WINDOW_TYPE_NORMAL") then
return
end
-- Associate Qubes to a specific workstation(Format = NameoftheAppVM or NameoftheAppVM+Nameoftheapplication)
workspaceAssociation = {};
workspaceAssociation["vault"] = 1;
workspaceAssociation["vaultgedit"] = 2;
workspaceAssociation["whonix-ws-15-test"] = 25;
workspaceAssociation["whonix-ws-15-testTor"] = 26;
workspaceAssociation["dom0"] = 33;
-- Can detect dispxxxx qubes VM and place it depending of his template
domain = get_window_property('_QUBES_VMNAME');
if (domain == "") then
domain = "dom0";
elseif (string.find(string.lower(domain), "disp")) then
amazingCommand = "sudo qvm-ls|grep " .. domain .. " | tr -s ' ' | cut -d ' ' -f 5| tr -d '\r'"
local handle = io.popen(amazingCommand)
result = handle:read("*a")
result = result:sub(1, -2)
handle:close()
debug_print("This is a dispVM : " .. domain .. "with the following template " .. result)
domain = result;
end
--match a specific application (gedit) from a specific template(vault) to a specific workspace ( Number 2, called vaultgedit)
if string.match(get_application_name(), "gedit") then
domain=domain.."gedit"
if (workspaceAssociation[domain] ~= nil and workspaceAssociation[domain] > 0) then
debug_print("Name application : " .. get_application_name())
end
end
if string.match(get_application_name(), "Tor") then
domain=domain.."Tor"
if (workspaceAssociation[domain] ~= nil and workspaceAssociation[domain] > 0) then
debug_print("Name application : " .. get_application_name())
end
end
-- Move the window to the workspace
if (workspaceAssociation[domain] ~= nil and workspaceAssociation[domain] > 0) then
if (workspaceAssociation[domain] <= get_workspace_count()) then
set_window_workspace(workspaceAssociation[domain])
debug_print("Moving ".. get_application_name() .." to workspace ".. workspaceAssociation[domain] .."\n\n")
maximize()
end
endqube = get_window_property("_QUBES_VMNAME");
ws = 0;
end
Features :
-
Can detect dispxxxx qubes VM and place it depending of his template to a specific workplace
-
match a specific application (gedit) from a specific template(vault) to a specific workspace ( Number 2, called vaultgedit)
-
And of course move the window to a specific workspace