On Sunday, February 18, 2018 at 11:00:35 PM UTC+1,  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,  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. > > 
@  Aight, I followed up on your suggestion and made a wiki for this script. Feel free to use it any way you like. https://github.com/Aekez/scripting-qubes/wiki/Streamlining-the-Screenshotting If our scripts in the end can't be merged without loosing strengths or avoiding new weaknesses in them, then perhaps an idea could be to use ideas from each others scripts which work. For example if you're okay with it I might add the clipboard functionality. Of course crediting you. But then there is the question if our scripts could essentially be merged into a single script by such a move? If so, then I don't mind you posting it, I'll simply add a reference to your script in the wiki so anyone reading it will be made aware of yours. Credits doesn't matter much to me, so I don't mind if you put a merged script together, if this is what is feasible to do. I've been thinking about adding a page to other Qubes community wiki pages. Maybe we can take this even further, thereby creating a sort of network by Qubes Community users who make wiki's like these. Kind of like how various YouTube communities share and promote each others videos and work to help carry out their collective and shared community goals. Maybe we can do something like this in the wiki pages and work together to create better wiki available information? For example I remember Ivan made a wiki for Windows 7 on github, which can be a good place for Windows wiki updates. (I don't know anyone else's wiki pages, I only know Ivan's). Yours holding the finished screenshot script, and other things you're working on of course. My own project is QubesTV, but as mentioned on the page, it's not something I can finish my self if it's meant to reach high quality. Currently I'm doing whatever I can to lay the ground-work though. But the idea here, is having wiki pages for various topics, and network them together. What do you guys think? -- 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 firstname.lastname@example.org. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/c6ffda3f-283c-48d7-9612-685fa07a722d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.