From 6f8e85c65f4ba1c5797acc9df8567f35b773bc61 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Fri, 2 Apr 2021 19:30:25 +0200 Subject: [PATCH] [sxiv] Add shotcut to copy a single image The first image marked in sxiv will be the only one copied --- .config/sxiv/exec/key-handler | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.config/sxiv/exec/key-handler b/.config/sxiv/exec/key-handler index 3bcbcc1..8130d63 100755 --- a/.config/sxiv/exec/key-handler +++ b/.config/sxiv/exec/key-handler @@ -21,4 +21,8 @@ switch "$argv[1]" for f in $FILES convert -rotate 270 "$f" "$f" end + case "y" + set FILE $FILES[1] + set TYPE (file -i $FILE | sed -r 's|.*(image/[a-z]+);.*|\1|') + xclip -sel clip -t "$TYPE" -i "$FILE" end