Starting/launching an application with arguments/parameters (qvm-run)

Hello, embarrassingly basic question here. I’m trying (unsuccessfully) to add parameters/arguments to a dom0 Xfce panel launcher.

Specifically, I’m trying to get Nautilus to launch in a non-default folder.

By standard any qubes nautilus app launcher seem to use the command:
qvm-run -q -a --service -- [QUBE-NAME] qubes.StartApp+org.gnome.Nautilus

Having googled, it looks like plenty of people have tried adding arguments to the end in various patterns with no luck, so I haven’t attempted with that.

However I did find one case on these forums where somebody added their arguments to the relevant destination qube’s .desktop file and that apparently worked for them. However I’ve tried adding arguments (IE the folder I want Nautilus to open) to “Exec=” in /user/share/applications/org.gnome.Nautilus.desktop in the destination qube to no effect.

Anyone know if I’m approaching this the right way here? I’m starting to suspect I’m going about this completely the wrong way.

I have just tried using qvm-run test-qube nautilus /home/user/QubesIncoming and it launched nautilus on my test-qube VM opened at the QubesIncoming folder.

Does this use qubes.VMShell to start nautilus? As I can recall this is not the safe way to start programs.

If I can recall, I did suggest that and it worked. It was starting browser with some flags…

Edit nautilus desktop file in the template of the [QUBE-NAME], add target directory at the end of [Desktop Entry] section, for example

Exec=nautilus /home/user/temp

Save it, and start from dom0 with the command above.

Sorted, Thanks everyone!

I went with enmus’s solution in the end, since I was already attempting it and it seemed the least likely to result in “unintentional side effects” via me tinkering with forces I don’t understand.

I’ll mark his response as the solution, since it correctly answers the question in the thread title.

However, it’s not that simple when it comes to Nautilus

It turns out you also need to change

Otherwise the Exec command and everything with it will be completely ignored in favour of /usr/share/dbus-1/services/org.gnome.Nautilus.service (Which i’ve avoided trying to edit as i’m woefully unfamiliar with all this dbus stuff. And from what I can gather there’s minimal downsides to me disabling it here.)

1 Like

This is why it has to be this way