screenshot: send to VM ??

45 views
Skip to first unread message

haaber

unread,
Feb 8, 2020, 4:01:34 AM2/8/20
to qubes-users
Hi, when I press PrintScreen (under xfce), I get several options, among
which save-in-dom0. It would be nice to be able to send it directly to a
VM. Can this be done? Cheers, Bernhard

Claudia

unread,
Feb 8, 2020, 7:13:42 AM2/8/20
to haaber, qubes-users

I haven't tested it, but try something like this:

#!/bin/bash
qvm-copy-to-vm $(zenity --entry --title='Send to VM' --text='Destination VM') "${BASH_ARGV[@]}"

Save that as an executable script, such as "~/.local/bin/send-to-vm.sh". Then, open dom0 file manager, right click any png, click open with other application, and under "use a custom command" enter "send-to-vm.sh %s". Then, when you take a screenshot, instead of choosing "save", choose "open with..." and see if your script shows up in the list of available applications. If not, you might have to write a simple .desktop file in ~/.local/share/applications in order for it to show up as an option.

Again, this is just an idea off the top of my head and totally untested.

haaber

unread,
Feb 8, 2020, 7:19:54 AM2/8/20
to qubes...@googlegroups.com
Thank you. Of course I can do a second step after PrintScreen: change to
my dom0 terminal to run qvm-copy-to-vm. That is what I do since ever. My
question is rather how to integrate a new "send-to-VM" function in the
screenshot application so that it is only one step: PrintScreen & select
destination appVM ... I guess the PrintScreen "app" is a simple script,
hidden somewhere, as well? I'd like to extend it. Bernhard


Claudia

unread,
Feb 8, 2020, 9:33:33 AM2/8/20
to haaber, qubes...@googlegroups.com

Okay, no offense, but that's pretty much *exactly* what I described. The idea is that from the screenshot menu, instead of clicking save, you click "open with send-to-vm.sh", and then a zenity GUI window will pop up asking you for the destination VM name. If you want a list to select from, change it to something like `qvm-ls | cut zenity --list`. I don't see how it could be any more integrated. If you believe I am mistaken, please point out exactly how my solution differs from what you're trying to achieve.

You might also be interested in the Qubes Screenshot Tool instead
https://github.com/evadogstar/qvm-screenshot-tool

> I guess the PrintScreen "app" is a simple script,
> hidden somewhere, as well? I'd like to extend it. Bernhard

No, it's a binary. https://git.xfce.org/apps/xfce4-screenshooter

The PrintScreen key is mapped to screenshooter by default, but you can map it to something else via System Tools > Keyboard. You can also remap it to "screenshooter --open send-to-vm.sh" to skip the save/open/upload dialog and instead go right to the destination VM dialog.

See also
https://docs.xfce.org/apps/screenshooter/usage
https://askubuntu.com/questions/252738/configure-xfce4-screenshooter-settings
https://www.commandlinux.com/man-page/man1/xfce4-screenshooter.1.html

Ulrich Windl

unread,
Feb 8, 2020, 6:47:15 PM2/8/20
to clau...@disroot.org, qubes...@googlegroups.com, haa...@web.de
I just want to say that I'd vote for this feature as the user is expected not to save screenshots in Dom0. Maybe some "Set default destination VM" would be useful for programs that want to save files...
>>> Claudia 08.02.2020, 13:13 >>>
February 8, 2020 9:01 AM, "haaber" <haa...@web.de> wrote:
I haven't tested it, but try something like this:
#!/bin/bash
qvm-copy-to-vm $(zenity --entry --title='Send to VM' --text='Destination VM') "${BASH_ARGV[@]}"
Save that as an executable script, such as "~/.local/bin/send-to-vm.sh". Then, open dom0 file manager, right click any png, click open with other application, and under "use a custom command" enter "send-to-vm.sh %s". Then, when you take a screenshot, instead of choosing "save", choose "open with..." and see if your script shows up in the list of available applications. If not, you might have to write a simple .desktop file in ~/.local/share/applications in order for it to show up as an option.
Again, this is just an idea off the top of my head and totally untested.
--
You received this message because you are subscribed to the Google Groups "qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/a42f6d34f4b880b585823f17a3992eec%40disroot.org.

Eva Star

unread,
Feb 11, 2020, 12:16:01 PM2/11/20
to qubes-users
> I just want to say that I'd vote for this feature as the user is expected not to save screenshots in Dom0.  Maybe some "Set default destination VM" would be useful for programs that want to save files... 

use my tool github.com/evadogstar/qvm-screenshot-tool . what is the problem?

Reply all
Reply to author
Forward
0 new messages