img: image viewer wrapper - scripts - various script and utils
HTML git clone git://z3bra.org/scripts
DIR Log
DIR Files
DIR Refs
---
DIR commit eeb0649ba53d5feb0e4d009688ccfc83a5ef299b
DIR parent 1e86c2eaa87b6bfa7ae9c138d8c97ffc895f6990
HTML Author: Willy Goiffon <dev@z3bra.org>
Date: Thu, 20 Aug 2026 23:18:02 +0000
img: image viewer wrapper
Diffstat:
A img | 10 ++++++++++
M plumb | 11 ++---------
2 files changed, 12 insertions(+), 9 deletions(-)
---
DIR diff --git a/img b/img
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+exec 2>/dev/null
+if [ $# -eq 0 ]; then
+ f=$(mktemp -p /tmp img.XXXXXX)
+ cat > $f
+ trap 'rm -f $f' EXIT QUIT TERM INT
+fi
+
+imv-wayland "${@:-$f}"
DIR diff --git a/plumb b/plumb
@@ -3,7 +3,7 @@
# all these have the same result:
#
# plumb -u https://z3bra.org/z3bra.png
-# echo https://z3bra.org/z3bra.png | wl-copy; plumb
+# echo https://z3bra.org/z3bra.png | xsel; plumb
# echo https://z3bra.org/z3bra.png | plumb -s
# curl -s https://z3bra.org/z3bra.png | plumb -
@@ -102,14 +102,7 @@ case "$mime" in
image/gif) exec mplayer -loop 0 "$uri" ;;
audio/*) exec mpv -cache 512 "$uri" ;;
video/*) exec mpv -cache 512 "$uri" ;;
- image/*)
- if [ -n "$proto" ]; then
- tmp=$(mktemp -p /tmp plumb.XXXXXXXX)
- pipe "$uri" > $tmp
- uri=$tmp
- fi
- imv-wayland "$uri"
- ;;
+ image/*) pipe "$uri" | img ;;
text/*)
if [ -n "$proto" ]; then
tmp=$(mktemp -p /tmp plumb.XXXXXXXX)