Autostart program in specific workspace

You may find this useful:

workspace_associations = {};
workspace_associations["personal-signal"] = 1;
workspace_associations["personal-email"] = 2;
workspace_associations["personal-vault"] = 3;

fullscreen_apps = {"Signal", "Thunderbird", "KeePassXC", "Firefox"}

domain = get_window_property('_QUBES_VMNAME');
if (domain == "") then
	domain = "dom0";
elseif (string.find(string.lower(domain), "disp")) then
	domain = "disp";
end

application = get_application_name();

window = get_window_name();

debug_print("Domain: " .. domain);
debug_print("Application: " .. application);
debug_print("Window: " .. window);

-- If the domain has a workspace association, then move the window to that workspace.
if (workspace_associations[domain] ~= nil and workspace_associations[domain] <= get_workspace_count()) then
	workspace_number = workspace_associations[domain];
	debug_print("Moving " .. application .. " to workspace " .. workspace_number .. "\n");
	set_window_workspace(workspace_number);
end

-- Maximize all fullscreen applications.
for _, fullscreen_app in ipairs(fullscreen_apps) do
	if (string.find(string.lower(window), string.lower(fullscreen_app))) then
		debug_print("Maximizing " .. application  .. "\n");
		maximize();
	end
end
3 Likes