xsel fails, with error: "xsel: Conversion refused"
Attempting to troubleshoot, I've learned that `xsel -o` can show the contents of the clipboard, but `xsel` fails to set the clipboard. Both `xsel -v` and `xsel -b -v` fail with the "conversion refused" messages. `xsel` works fine when I run it from a terminal. The error occurs only when running via qrexec.
For some context, if you're interested... I recently became aware of a password manager with some interesting features: https://github.com/renatoathaydes/go-hash. I'd like to modify it, so that it both opens a URL in a VM, and places a password in that VM's clipboard. I've got most of that working, except that I can't get the password into the clipboard, because xsel fails with "conversion refused".
I'll attach a file, which is a version of the script I'm working on. It's based on /etc/qubes-rpc/qubes.OpenURL. In addition to opening URLs, it takes the first line of stdin and uses `xsel` to put that line into the clipboard. It doesn't work. If you change `xsel -v`, you'll see it gets the error I've described in the first post.
I've written a qrexec script which, among other things, attempts to place something into the clipboard, using `xsel`.
xsel fails, with error: "xsel: Conversion refused"
Hey, good idea. Not sure why I hadn't thought to try `xclip` earlier. While I'd still like to know what xsel is complaining about, I'm able to get it working with xclip.
I've started making a qubes-specific version of `go-hash`, a tool for managing passwords. I like one feature in particular: open a URL while copying a password to the clipboard. I renamed my version `qpass`, and created command "appvm" which opens a URL in an appvm while copying the password to that appvm's clipboard. The "dispvm" command is similar, but opens a disposable vm.
Work (still a bit in progress) is here:
https://github.com/dncohen/qpass/tree/qpass
The idea is to run `qpass` in a vault, and use it to launch URLs in app vms that have network access. While qubes copy/paste is pretty good, I find that I can get sloppy with it, sometimes manually pasting to the wrong vm. I'm hoping this approach is a little more idiot-proof.
-Dave
Just to update this thread... it turns out I was trying to have xsel work with an invalid utf8 string. I fixed a bug in the code generating a password string. Once it was proper utf8, xsel works fine (although running verbose, it still warns "conversion refused" - no idea what it is referring to.)