When AppVM is launched, the application also wants to specify a workspace (specified as one of 1.2.3.4) to be launched automatically

(As an aside) Previously, when I increased the version of Brave, the frame when right-clicked turned thick and black, but I just did a system update and the problem has been resolved.I am very happy.

When I start QubesOS, I start untrusterd, Vault and DisposableVM manually and start the applications manually as well, but I want to start the specified applications automatically when each AppVM is started.

I found the Gnome? in the topic, but I don’t know how to write the automatic launch in xfce and would like to know if you can do it.

1 Like

Create a link or copy the app’s desktop file to the ~/.config/autostart to start it at qube’s boot e.g.:

mkdir -p ~/.config/autostart/
ln -s /usr/share/applications/qubes-run-terminal.desktop ~/.config/autostart/qubes-run-terminal.desktop

How to install software | Qubes OS

For opening app window in a specific workspace you can use devilspie2 in dom0:

2 Likes

Thanks, I installed devilspie2 and created

~/.config/devilspie/ws.lua.

I had to type it in manually, so I typed it using the code created by a community member, will this still work?

qube = get_window_property(“_Qubes_VMNAME”);
ws = 0;
if qube == “untrusted” then
ws = 1
elseif qube == “vault” then
ws = 2
end
if ws > 0 then
set_window_workspace(ws);
change_workspace(ws);
end

Also, in order to automatically start devilspie2 with dom0, i need to register the application at session and startup, where is devilspie2?

1 Like

I think it should be ~/.config/devilspie2 instead of ~/.config/devilspie.

It should work.

Q → Gear icon → System Settings → Session and Startup → Application Autostart tab → press on + button
Name: devilspie2
Command: devilspie2
Press OK.

2 Likes

Thank you, I registered devilspie2 as a session and startup, and the untrusted one started automatically, and the vault one started manually because I couldn’t find a link to the VisualStudioCode app, but the untrusted one ws1,It is shown on the leftmost of the four Workspaces.

I tried to change the settings to see if it was ws3 instead of ws2, but it is the same and starts on the ws1 screen.For VisualStudioCode, I looked at the list displayed in

ls /usr/share/applications/

but could not find it.Where can I find the .desktop file?Have i also made any mistakes that the devilspie2 configurator is prone to making?

1 Like

_Qubes_VMNAME value is empty in devilspie2 for some reason, but if checking the window properties using xprop then the _Qubes_VMNAME value is set correctly.
No idea what’s wrong with it, maybe there is some change in Qubes OS 4.2 that broke it. Maybe it’s new devilspie2/Xorg version that is broken or some change in Qubes OS tools.
You can use WM_CLASS property value as a workaround:

if get_window_property('_QUBES_VMWINDOWID') ~= '' then
    qube = get_window_property('WM_CLASS'):match("[^:]+")
    ws = 0;
    if qube == "untrusted" then
        ws = 1
    elseif qube == "vault" then
        ws = 2
    end
    if ws > 0 then
        set_window_workspace(ws);
        change_workspace(ws);
        focus();
    end
end
1 Like

I could only type it in manually.I then rebooted and tried to start the vault application VisualStudioCode, but hmmm, it still starts in WS1 and not in the WorkSpace next to it.
If there are any typos, please let me know.

if get_window_property(‘_QUBES_VMWINDOWID’) ~= ‘’ then
qube = get_window_property(‘WM_CLASS’):match(“[^:]+”)
ws = 0;
if qube == “untrusted” then
ws = 1
elseif qube == “vault” then
ws = 2
end
if ws > 0 then
set_window_workspace(ws);
change_workspace(ws);
focus();
end
end

1 Like

Check if devilspie2 is running in dom0:

ps aux | grep devilspie2

If it’s not running then try to start it manually and see if it’ll give you any errors:

devilspie2
2 Likes

Sorry for the late reply.

@dom0 ~]$ ps aux | grep devilspie2
28368 0.0 0.0 222032 2432 pts/6 S+ 20:15 0:00 grep --color=auto devilspie2
[@dom0 ~]$

It appears to be activated.

1 Like

No, it’s not running, the output just shows that grep devilspie2 command is executed.
Try running the devilspie2 command manually in dom0 terminal and see if it’ll give you any errors.

2 Likes

Hmmm, I tried manually activating it, but it comes up as non-existent.

[@dom0 ~]$ devilspie2
No script files found in the script folder - exiting.
[@dom0 ~]$

1 Like

Did you place the config file in the correct directory?

2 Likes

Thanks.I also checked the directory with the ws.lua file (~/.config/devilspie), where the code you gave me is located, but it seems that devilspie2 does not start automatically after reboot.

@dom0 ~]$ ps aux | grep devilspie2 28368 0.0 0.0 222032 2432 pts/6 S+ 20:15 0:00 grep --color=auto devilspie2 [@dom0 ~]$

The same results are output.I reviewed the code and found that I had used two single quotes when I should have used double quotes, so I corrected this, but there may be other typos.

1 Like

The devilspie2 config file should be placed in the ~/.config/devilspie2 directory and not in the ~/.config/devilspie directory.

2 Likes

I must have been mistaken, I copied the ws.lua I had saved in the devilspie directory to devilspie2, rebooted and devilspie2 seems to be working.

[@dom0 ~]$ ps aux | grep devilspie2
4695 97.7 0.4 441556 19072 ? Rl 17:55 3:59 devilspie2
5244 0.0 0.0 222164 2432 pts/6 S+ 17:59 0:00 grep --colour=auto devilspie2
[@dom0 ~]$

but after reboot, the vault is trying to screen to WS2 VisualStudioCode is to be started in WS1 at startup.If that is the case, the rest of the code is likely to be typed incorrectly.

1 Like

I couldn’t understand your problem, can you rephrase it (maybe using simpler sentences) and add more details?

2 Likes

Excuse me.First of all, when I reboot, devilepie2 starts automatically.On top of that, untrusted, disposableVM and vault’s AppVM start automatically, and untrusted’s thunderbird/discord/Brave start automatically. vault’s VisualStudioCode remains unset because it could not find the applicationI couldn’t find “.desktop” and disposableVM was not configured, so it is left unconfigured.

The code presented by apparatus this time, I think I have the settings to distinguish which WS to use when running the untrusted and vault applications. untrusted automatically starts in the WS1 workspace, which is ok.But the vaulted application, VisualStudioCode, starts manually, but not in WS2, which I have set up.This is the situation.So, the two problems I have are

  • I want to be able to start VisualStudioCode automatically, and to be able to place it in WS2
  • I want to be able to start Brave automatically for DisposableVM as well.

I would like to check the code as it is most likely my typo.

1 Like

It works fine for me so it’s most probably a typo.
If you won’t be able to find the typo then you can copy the script from dom0 like this:
How to copy from dom0 | Qubes OS
And paste it here so I could take a look.

First find the name of the .desktop file: go to vault qube’s Settings → Applications and point the mouse cursor over the VisualStudioCode entry, it’ll show the tooltip with the .desktop filename e.g. VisualStudioCode.desktop.
In the vault terminal run this command:

sudo find / -name "VisualStudioCode.desktop"

And it’ll show you the path to the .desktop file.
Then configure it to autostart:
How to install software | Qubes OS

Same as for VisualStudioCode, but do it in a disposable template qube.

2 Likes

Thanks, this is the content of ws.lua in devilepie in the Config directory of dom0.

if get_window_property(‘_QUBES_VMWINDOWID’) ~= " then
qube = get_window_property(‘WM_CLASS’):match(“[^:]+”)
ws = 0;
if qube == “untrusted” then
ws = 1
elseif qube == “vault” then
ws = 2
end
if ws > 0 then
set_window_workspace(ws);
change_workspace(ws);
focus();
end
end

Also in Vault,

sudo find / -name “VisualStudioCode.desktop”

If I run this command, I will get a No permission.

sudo find

and ,

sudo find /

I think it probably happens when -name is given, because it works if -name is given.

1 Like

Use the “Preformatted text” instead of “Blockquote” to write the config files, commands etc, use:
```
text
```
Instead of:
> text

When you use “Blockquote” it’s replacing the quote characters to another character e.g.:
" to
' to
These characters are wrong if used in the config file.

Here:

It should be two single quote characters ' instead of a double quote character ".

It works for me.
Copy the executed command and its output from the terminal e.g.:

user@vault:~$ sudo find / -name "xfce4-terminal.desktop"
/usr/share/xfce4/helpers/xfce4-terminal.desktop
/usr/share/applications/xfce4-terminal.desktop
2 Likes