pqiv icon indicating copy to clipboard operation
pqiv copied to clipboard

output path of marked images in montage mode

Open nagy135 opened this issue 1 year ago • 1 comments
trafficstars

Hello, I used to use sxiv on linux as a picker for my scripts. Basically all I need is to select some images and somehow exit outputing paths to these selected ones.

Is anything like this possible? I can mark but nothing is outputed after close. Is there a way to do that ?

nagy135 avatar Jan 13 '24 14:01 nagy135

something like

echo "output_marked_file_list(); quit()" | pqiv --actions-from-stdin folder

nagy135 avatar Jan 13 '24 14:01 nagy135

A step there might be if commands were also accepted from montage mode (which currently they are not). Then you could call pqiv --command-1=-"cat > your-list-file". You get some of the way already if you mark, then go from montage mode into the image, and press 1. (It's not "on exit", but the command might even kill the pqiv that launched it after writing to the file).

chrysn avatar Jan 31 '24 21:01 chrysn

probably, i cant code C so i did the only logical thing and started writing minimal version of that in rust 😂

nagy135 avatar Jan 31 '24 21:01 nagy135

Actually I do think that this can be achievable without even knowing C. The numeric key bindings are just not bound in montage mode by default. I don't remember off my head how pqiv key bindings are configured, but chances are you can even bind q (or however you want to be done) in montage mode to numeric_command(1), and then if you set --command-1="-my_command && pkill pqiv", and you get the behavior you desire.

chrysn avatar Jan 31 '24 21:01 chrysn

Right, it's as simple as that :)

./pqiv --bind-key "@MONTAGE { 1 { command(-cat); quit(); } }" your_folder/

phillipberndt avatar Feb 16 '24 13:02 phillipberndt