How To HotKey Opening A File In An AppVm?

Say I have an appVM running, with files I want to access with a single hotkey.

Is it possible to wire up a hotkey that will open a file in an AppVM? If so, hows it done?

qvm-run offline "libreoffice ~/Documents/secrets.odt"

  • with qvm-run you can execute commands in a qube
  • offline being the name of the example qube
  • libreoffice ~/Documents/secrets.odt being the command

Then you simply hook this up in XFCE settings | Keyboard | Application Shortcuts

3 Likes

This too should be ā€˜User support’

Hello! I know old topic. Does this still work? Its not working for me. Its a great idea. Ive tried entering this directly in Qubes System Tools>Settings Manger>Keyboard>Application Shortcuts qvm-run libreoffice work ~Documents/PCPD.pdf using shortcut keys Control+space and nothing happens… I also tried to go directly into AppVM and go to Application Shortcuts in XCFE and that one does not have a qvm-run option. This sounds wonderful and simple, but for the last hour I just cant seem to make it work. Did this ever work?

You’re running a wrong command, if you want to open ~/Documents/PCPD.pdf file using libreoffice in qube named work then it should be:
qvm-run work "libreoffice ~/Documents/PCPD.odt"
Try to run this command in dom0 terminal before you try to run it using a shortcut to make sure that it works.

Thanks so much! Running in terminal is super helpful as it shows explanations as to why things arent working… Made much progress however, I get a new error… i tried ā€œ~/Documentsā€ and then i tried ā€œhome/user/Documents/CH.odtā€ because this is how it shows in nautilus properties for the file. But for some strange reason, i get ā€œhome/user/home/userā€ But i only entered it once.
run-qvm

qvm-run2

I found the answer! After a few hundred attempts I found something that works! qvm-run WORK libreoffice Documents/CH.odt Thank You! (yes for some reason, at some point in time, I renamed my ā€œworkā€ qube to ā€œWORKā€) for some reason my other two replies might have been to myself, well I am sorry about that, thanks so much for your help!

Specify the absolute path:
~/Documents/CH.odt
or
/home/user/Documents/CH.odt
Don’t remove / at the beginning or you’ll be using path to the file relative to the current ditectory (/home/user by default) instead of the absolute path.

The only way it works is if I remove / … Nothing else works, i tried ~/Documents/CH.odt, and i tried /home/user/Documents/CH.odt (which for some reason outputs home/user/home/user/Documents/CH.odt)… The only way it works on this computer is qvm-run Documents/CH.odt Maybe i screwed something up and now it doenst work like its supposed to, but at least it works now and all is well!.. Thank You! YeeeeeHawl!