pqiv
pqiv copied to clipboard
can't use it in .mailcap
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.
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.
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. ;)
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.
You probably don't have gvfs installed, see #86.
(Btw, $@ expands to all arguments in sh.)
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).
It should suffice to run gvfsd.