2

While trying to copy files into the clipboard through bash, I ran into a bit of trouble. I'm currently using 'xclip -i -selection clipboard -t text/uri-list <<< $1' . The script works as expected in QT apps, but gtk doesn't seem to recognize the files/folders copied.

Am I using the wrong mimetype ('text/uri-list'), or should the files not be in the format "file://path/to/file.extension" or is it something else?

varikas
  • 21
  • 5
  • 1
    Ok, I figured out how to copy files into gtk filemanagers, by using this script: `echo -e "copy\n$1\0" | xclip -i -selection clipboard -t x-special/gnome-copied-files`. But now I have a problem that they won't copy into qt filemanagers. How do I manage to copy to both? – varikas Oct 18 '17 at 21:18
  • After looking into it, It appears that I need to set multiple targets, such as `text/plain`, `text/uri-list` and `x-special/gnome-copied-files` with separate data, but it doesn't appear to be possible. Is there some alternative tool that can do it or could it be done directly within gnome shell extensions? – varikas Oct 18 '17 at 23:47
  • Specifying multiple targets is currently not possible in `xclip`: https://github.com/astrand/xclip/issues/32 – aplaice Apr 15 '18 at 00:13

0 Answers0