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

I see, > it is not good to use this, I understand.I would like to put the config file again.

GNU nano 6.4 ws.lua

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

I changed it, probably because the " in front of then was not ‘’ (the " above was changed to ‘’).‘’) (the code above is before the change).but when I start VisualStudioCode manually, it starts up with WS1.I confirm that the devilspie2 is started with the ps aux command.

1 Like

You’ve used the wrong characters for quotes. You need to use ' and not .
Copy the current config file content from dom0 and post it here.
You can copy it like this:
How to copy from dom0 | Qubes OS

2 Likes

Sure, we used that copy method to paste it here, but now we paste the text of the config file that we have.

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

If there are any typos, we would be grateful if you could let us know.Best regards.
(It’s spaced in tabs on the submission screen, but when you post it, it’s left-aligned.)

The quotes are converted to the wrong characters again, use “Preformatted text” so it won’t happen like this:
```
‘text’
```
so it’d be shown as this:

'text'

Run this command in dom0 and post its output:

killall devilspie2; devilspie2

To stop the command execution press Ctrl+C in the terminal.

1 Like

Thank you.

killall devilspie2; devilspie2

the logs is below.

[@dom0 ~]$ killall devilspie2; devilspie2
/home/flo/.config/devilspie2/ws.lua:1: unfinished string near ‘" then’
^C
Received signal: 2 (割り込み)
[@dom0 ~]$

「割り込み」 is “muscling in on”

You have some error in the first line of the config.
Copy and post the config as “Preformatted text”:

1 Like

Is this by any chance what you mean by this…?

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

Oh!The space and other features have been properly reproduced.How about this…?

Yes, but you can use the block code formatting instead of inline code formatting so you won’t need to add ` characters around every line:
Posting code or preformatted text - Using Discourse - Discourse Meta

There are no errors in this config and I’ve tried this exact config and it works for me without errors.
Maybe you have multiple configs in the /home/flo/.config/devilspie2/ directory and there is another config with the error?
What’s the output of this command?

ls -la /home/flo/.config/devilspie2/
1 Like

I had thought that both “devilspie” and “devilspie2” existed in the config directory, and I had thought that it was a code mistake in ws.lua in the devilspie directory, but I reviewed the code in the devilspie2 directory and corrected it.

I was not able to do it, so I fixed it here, restarted and started the vault VisualStudioCode, and it was successfully started with WS2.Thank you very much.

I also want to digest one more remaining issue: trying to search VisualStudioCode with the find command,

user@vault:~$ sudo find / -name "visualstudiocode"
find: ‘/run/user/1000/doc’: 許可がありません
user@vault:~$ su
root@vault:/home/user#  sudo find / -name "VisualStudioCode.desktop"
find: ‘/run/user/1000/doc’: 許可がありません
root@vault:/home/user# su -
root@vault:~# find / -name "VisualStudioCode.desktop"
find: ‘/run/user/1000/doc’: 許可がありません
root@vault:~# sudo find / -name "VisualStudioCode.desktop"
find: ‘/run/user/1000/doc’: 許可がありません
root@vault:~# 

「許可がありません」 means “not permitted” .How can I pass the permission here?

You can ignore this message, find command searched everywhere except /run/user/1000/doc directory but the .desktop file won’t be in /run/user/1000/doc directory so you can ignore it.
There is no file named VisualStudioCode.desktop in the system.
You need to first fine the correct name of the desktop file like this:

The VisualStudioCode.desktop here is just an example, I don’t know how the file is actually named.

1 Like

Thank you.I see that I can ignore the message stating that I do not have permission.VisualStudioCode was indeed in the application field of VaultCube.“Visual Studio Code” and there was a space, so I tried

sudo find / -name “Visual-Studio-Code.desktop”

but nothing came up in the search results.Are there any rules for searching, or is there some kind of formatting, such as putting _ in a space?

Try this:

sudo find / -iname "Visual*Studio*Code*.desktop"

Or this:

sudo find / -iname "*visual*.desktop"
1 Like

I tried searching with an asterisk, but it didn’t come up.Hmm, is it inherited in Vault from what is in Template?and use it, but does it have to be installed directly to come up?

DId you try to search with -iname instead of -name as well?
Try this:

sudo find / -name "*.desktop" | xargs grep -il "studio"
1 Like

Didn’t come out… sad…

user@vault:~$ sudo find / -name "*.desktop" | xargs grep -il "studio"
find: ‘/run/user/1000/doc’: 許可がありません
/usr/share/applications/code.desktop
/usr/share/applications/code-url-handler.desktop
grep: /usr/share/plasma/look-and-feel/org.debian.desktop: ディレクトリです
user@vault:~$ 

What’s the content of /usr/share/applications/code.desktop file?
Maybe that’s the .desktop file for Visual Studio Code.

1 Like

Thanks, I had just assumed that code…desktop was for a different application.This one in the Vault terminal,

mkdir -p ~/.config/autostart/
ln -s /usr/share/applications/code.desktop ~/.config/autostart/code.desktop

When I did this, I was able to get it to start automatically.
I see, I learned how to search in this way.Thank you very much.

We will now consider this topic resolved.Again, thank you very much.