Autostart program in specific workspace

I use autstart as outlined in the documentation. All programs start in the first workspace. Is there a way to specify a different workspace on a per program basis? Thank you!

2 Likes

With KDE it’s possible:

And also with XFCE (the default desktop environment). But I’m not sure how.

1 Like

Use devilspie2, which can be installed via sudo qubes-dom0-update devilspie2

Then under ~/.config/devilspie2/ create ws.lua

In it write this:

qube = get_window_property("_QUBES_VMNAME");
ws = 0;

if qube == “personal” then ws = 1;
if qube == “work” then ws = 2;

if ws > 0 then

set_window_workspace(ws);
change_workspace(ws);

end

4 Likes

Duplicate discussion here:

Thank you very much for pointing me to devilspie2! I did not know that such a good thing exists. What I was looking for was for instance placing a “personal” firefox in workspace 1, a “personal” thunderbird in 2 and a “vault” keepassxc in 4. I will look into lua scripts for that.
Thanks again.

I was searching for “autostart” so I overlooked it. Sorry!

No worries :slight_smile:

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
2 Likes

Thank you very much. I will try it out and report back.