On Sunday, February 18, 2018 at 11:00:35 PM UTC+1, [799] wrote:
> -- 
> Qubes 4rc3 > Lenovo X230 + Lenovo W540
> 
> Gesendet von ProtonMail mobile
> 
> 
> 
> 
> -------- Original-Nachricht --------
> An 18. Feb. 2018, 22:25, Yuraeitha wrote:
> 
> On Saturday, February 17, 2018 at 11:11:40 PM UTC+1, [799] wrote: 
> > Hello, 
> > 
> > having the idea of a qvm-screenshot-to-clipboard script I was eager to try 
> > writting a script. 
> > The solution I had in mind could work but I am struggling with a small 
> > issue and would like to get some help. 
> > The script takes a screenshot in dom0, store it to a file and qvm-copy the 
> > file to the target appvm (one and only command line argument for the 
> > script). 
> > Then within the AppVM it is using xclip to copy the graphic to clipboard 
> > and removes all temporary files in the AppVM and dom0 
> > All pieces are working, except the xclip command when launced from dom0. 
> > 
> > When I launch the command within the AppVM it is working. 
> > But I need to start the xclip command from an external script and when I do 
> > so, the same command is not working. 
> > It seems that I am missing something when using xclip via script which is 
> > run in a new terminal session (from dom0 but also within the App) 
> > 
> > Any ideas how to fix this? 
> > It feels so frustrating that I nearly have a working solution but I am 
> > missing the last few meters. 
> > 
> > How to use the script: 
> > 
> > 1) in dom0: launch script 
> > 
> > 2) make the screenshot by selection the area 
> > 
> > as the xclip is not working in the AppVM as supposed: 
> > 
> > 3) switch to the AppVM where the screenshot should be used 
> > 
> > 4) launch the "helper script" in the AppVM which is running the following 
> > command 
> > 
> > xclip -selection clipboard -t image/png 
> > /home/user/QubesIncoming/dom0/qvm-screenshot-to-clipboard.png 
> > 
> > My qvm-screenshot-to-clipboard script which has to be placed and run from 
> > dom0: 
> > 
> > --- BEGIN of script --- 
> > 
> > 
> > #!/bin/bash 
> > # qvm-screenshot-to-clipboard 
> > # Creates a dom0 screenshot and copy it to the Clipboard of an AppVM 
> > 
> > MyAppVM=$1 
> > MyScreenshot=qvm-screenshot-to-clipboard.png 
> > 
> > # 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 command line argument / delete existing file 
> > 
> > qvm-run $MyAppVM 'rm -f /home/user/QubesIncoming/dom0/$MyScreenshot' 
> > 
> > qvm-copy-to-vm $MyAppVM /tmp/$MyScreenshot 
> > 
> > ###FIXME begin 
> > 
> > # I would like to just invoke the following 
> > # command via qvm-run in the AppVM 
> > # but the clipboard is just empty when using 
> > # this approach. 
> > # running the same command 
> > # xclip -selection clipboard -t image/png 
> > /home/user/QubesIncoming/dom0/qvm-screenshot-to-clipboard.png 
> > # therof I have put the command into a helper 
> > # script in my AppVM: 
> > # qvm-run $MyAppVM /home/user/qvm-screenshot-to-clipboard-appvm.sh 
> > # the script is working when it is launched from 
> > # an already opened gnome-terminal window 
> > # but it will not work when the script is invoked 
> > # from dom0 via qvm-run or through an own  
> > # strangely it is also not working when I start 
> > # the script from within the appvm 
> > # 'xterm -e 
> 
> > If interested, I've recently made a similar
> > script that works a little differently.
> > [...]
> > mv "$(xfce4-screenshooter -fo ls)" ~/Screenshots 
> > ( sleep 3 ) 
> > qvm-move-to-vm Base ~/Screenshots/screenshot_* 
> > [...]
> 
> Your scripts can be used to save all screenshots to a folder in an AppVM 
> whereas my scripts is mainly for quick copy'n paste.
> 
> I think I'll also change my script to use xfce4-screenshoiter instead of 
> gnome-screenshot.
> Thanks for the hint.
> 
> I have uploaded my script to GitHub, maybe you should do the same or we add 
> it to the repository so that users can pick the right script for their needs?
> 
> As you mentioned:
> Choice is always a good thing.
> 
> [799]

btw, I don't mind if you merge some of the code, what I feel is important here 
is that people have something that just works. Besides a crucial part of this 
code is something I got elsewhere anyway, I just don't remember where anymore. 
In short, the mv "$()" part of the script to bypass the "save as" is not my 
invention, but something I learned elsewhere, where-ever that was in time and 
space.

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to qubes-users@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/b3a09260-755f-4c3d-b56f-61062ce10a57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to