Opening URLs/files in other Qubes

Very good stuff!

I shall humbly add an extension that I just trialed:

after setting up mybrowser.desktop as the default browser, which the above guide outlines, one may want to have files open in disposables as well, perhaps from specific applications, which don’t necessarily have this functionality, or open the files that would be opened by those applications in another VM directly, bypassing that application completely.
Note something like this will likely eventually make it into QubesOS with a nice GUI (see here), and there is also another guide with a bit of a different approach here, but maybe someone will find the following useful also (the main difference to the guide in the last link is that this will allow you to create your own mimetype list only for those applications you choose and I’ve found that there are some mimetypes that the list in that guide misses, though they’re not necessarily relevant in most situations):

  1. create new file in .local/share/applications, e.g. dvmviewer.desktop with same content as the desktop file in the above guide.
  2. replace the content of the field Name= in that file with something else, e.g. Name=dvmviewer
  3. open the desktop file of an application whose mimetypes you want opened somewhere else (look for desktop files in /usr/share/applications/)
  4. copy the parts of the Categories field in that file that aren’t already in your desktop file and add them to the existing parts in your file.
  5. copy the entirety of the MimeType= field’s contents and save them to a file, e.g. mimetypes.
  6. repeat steps 3 to 6 for all applications whose mimetypes you want handled in a different VM, simply adding to the file mimetypes, without creating new lines, so have it be one big line
  7. now we need to sort and deduplicate the file mimetypes; for that execute cat mimetypes | tr ';' '\n' | sort -u | tr '\n' ';' > mimetypes_deduped and copy the contents of the mimetypes_deduped file as the content of the MimeType= field in your desktop file
  8. now we set the VM to regard your desktop file, which launches some VM, e.g. a disposable, as the default application for all those mimetypes: execute cat mimetypes_deduped | tr ';' '\n' | while read -r line; do xdg-mime default dvmviewer.desktop $line; done

Opening a file of the processed mimetype, whether from nautilus / thunar or via xdg-open should now automatically open in the specified VM.

1 Like