I'm trying to write a command in vifm (on linux) that copies the content of an image to the clipboard, using copyq.
This is what I got so far:
I use the command xdg-mime query filetype myfile.jpg
to get the mimetype.
I use qcopy
to write the content of the file to the clipboard like this:
qcopy write $MIMETYPE - < myfile.jpg
The following command works fine in the shell and the content of the file gets copied to the clipboard:
qcopy write $(xdg-mime query filetype myfile.jpg) - < myfile.jpg
Now how can I rewrite this command as a vifm command in my vifmrc
file?
I tried this but it doesn't work:
command! copyf
\| let $MIMETYPE = system(expand('xdg-mime query filetype %c'))
\| execute expand("copyq write $MIMETYPE - < %c && copyq select 0")
I just get an "Invalid command name" error.