Q4rc4 :: SUCCESS qvm-screenshot-to-clipboard - 1st working version 0.1
29 views
Skip to first unread message
[799]
unread,
Feb 17, 2018, 7:02:45 PM2/17/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to aw...@danwin1210.me, qubes...@googlegroups.com
Hello,
after some troubleshooting I can now present a working alpha-solution for copy & paste screenshots between dom0 and AppVMs.
You might have to install 2 packages: xclip in your AppVM gnome-screenshot in dom0
I had to tweak the xclip command a bit and now the script does exactly what it should do.
You also don't need to have a helper script within the AppVMs, just copy the script to dom0 and launch it with:
qvm-screenshot-to-clipboard
Then choose the area you want to screenshot and switch to your AppVM and paste it. There is an effect that the xclip command will wait until you pasted the image before the script continues.
But this is a nice thing as you can get two notification:
1) Screenshot is available in AppVMs Clipboard 2) Screennshot has been pasted from AppVMs clipboard.
Attention:
This script has mainly be made to provide a quick workarround and to get inter-VM screenshots working.
There is much improvement for error detection and also mabye usability improvements that the script can be launched without a command line argument, presenting a popup after the screenshot to which AppVM the screenshot should be placed.
Feel free to improve this, I'll upload the code to GitHub.
regards
[799]
---- the script follows here ---
#!/bin/bash # qvm-screenshot-to-clipboard # Creates a dom0 screenshot and copy it to the Clipboard of an AppVM
# Take screenshot in dom0 by selecting an area and adding border+shadow gnome-screenshot --area --include-border --border-effect=shadow --file=/tmp/$MyScreenshot
# Copy screenhot to AppVM qvm-move-to-vm $MyAppVM /tmp/$MyScreenshot
# Create a helper-Script in the AppVM to copy screenshot file to clipboard echo "xclip -selection clipboard -l 1 -t image/png /home/user/QubesIncoming/dom0/$MyScreenshot" > /tmp/file2clipboard.sh chmod +x /tmp/file2clipboard.sh qvm-move-to-vm $MyAppVM /tmp/file2clipboard.sh # Send notification for 5sec when Screenshot has been pasted into (!) AppVM notify-send --urgency low --icon image --expire-time=5000 "qvm-screenshot-to-clipboard" "Screenshot available in $MyAppVM's clipboard" # Run the helper script in the AppVM qvm-run $MyAppVM /home/user/QubesIncoming/dom0/file2clipboard.sh
### The last command will remain active until the pasting has been done in the AppVM
# Send notification for 5sec after Screenshot has been pasted from (!) AppVM notify-send --urgency low --icon image --expire-time=5000 "qvm-screenshot-to-clipboard" "Screenshot pasted from $MyAppVM's clipboard"
# Remove helper script and screenshot file in AppVM qvm-run $MyAppVM "rm -f /home/user/QubesIncoming/dom0/file2clipboard.sh /home/user/QubesIncoming/dom0/$MyScreenshot"