pqiv icon indicating copy to clipboard operation
pqiv copied to clipboard

can't use it in .mailcap

Open magnetophon opened this issue 7 years ago • 6 comments
trafficstars

When I add the following in my ~/.mailcap:

image/*; pqiv %s

and try to open a file from rtv, nothing happens.

Doing the same with feh or mpv works.

magnetophon avatar Dec 12 '17 17:12 magnetophon

That works for me. Try replacing this with a script that stores away some debug intel:

$ cat > $HOME/pqiv-debug <<EOF
#!/bin/sh
exec >>~/pqiv.log 2>&1
echo Running pqiv $@
exec pqiv $@
EOF
$ chmod +x $HOME/pqiv-debug
$ mv ~/.mailcap ~/mailcap-backup
$ echo "image/*; $HOME/pqiv-debug %s" > ~/.mailcap

..then open something and check the contents of ~/pqiv.log.

phillipberndt avatar Dec 12 '17 19:12 phillipberndt

The script was broken, afaik, since it called pqiv without the filename. I changed it to:

#!/bin/sh
exec >>~/pqiv.log 2>&1
echo Running pqiv $1
exec pqiv $1

And now, when I test it with a local file, it puts this in the log:

Running pqiv /home/bart/Downloads/wetransfer-f976d3/DSCN2278.JPG
Invalid command: Missing closing parenthesis.

But it does open the file.

I have found the problem with rtv though: rtv has mostly urls to display, and apparently doesn't wget them first, but just passes them to the program.

So either I make a small script that wgets the file, or you make a feature in pqiv to handle url's. ;)

magnetophon avatar Dec 12 '17 19:12 magnetophon

OK, I just saw https://github.com/phillipberndt/pqiv/commit/d1543ea15bca8f686a390cc5756e108fef32cb72

So urls should work!

So here is the content of the log:

Running pqiv https://i.redd.it/uiso0rtdoi301.jpg
Failed to load image https://i.redd.it/uiso0rtdoi301.jpg: Operation not supported
No images left to display.

magnetophon avatar Dec 12 '17 19:12 magnetophon

You probably don't have gvfs installed, see #86.

(Btw, $@ expands to all arguments in sh.)

phillipberndt avatar Dec 12 '17 20:12 phillipberndt

I have gvfs installed, and I put it in the dependencies of the pkgs as well. Finally I enabled the service in NixOS.

I still get:

$ pqiv https://i.redd.it/uiso0rtdoi301.jpg
Failed to load image https://i.redd.it/uiso0rtdoi301.jpg: Operation not supported
No images left to display.

I do need to stress that NixOS is weird, in that no program knows about another unless explicitly told about it. We don't use the Filesystem Hierarchy Standard.

Furthermore I don't have the string gvfs in my list of processes, so maybe I need to run a full gnome environment to get it. (the part of the manual I linked above kind of hints to that).

magnetophon avatar Dec 13 '17 10:12 magnetophon

It should suffice to run gvfsd.

phillipberndt avatar Dec 23 '17 23:12 phillipberndt