From cd25808c26c23539bee780ed9c5f312174b9c47f Mon Sep 17 00:00:00 2001 From: katherine Date: Thu, 23 Jul 2026 17:08:37 +1000 Subject: update sxiv handlers --- .config/sxiv/exec/image-info | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to '.config/sxiv/exec/image-info') diff --git a/.config/sxiv/exec/image-info b/.config/sxiv/exec/image-info index 690ec17..f1c6298 100755 --- a/.config/sxiv/exec/image-info +++ b/.config/sxiv/exec/image-info @@ -1,19 +1,21 @@ #!/bin/zsh -# Example for ~/.sxiv/exec/image-info -# Called by sxiv(1) whenever an image gets loaded, -# with the name of the image file as its first argument. -# The output is displayed in sxiv's status bar. +# Example for $XDG_CONFIG_HOME/nsxiv/exec/image-info +# Called by nsxiv(1) whenever an image gets loaded. +# The output is displayed in nsxiv's status bar. +# Arguments: +# $1: path to image file (as provided by the user) +# $2: image width +# $3: image height +# $4: fully resolved path to the image file s=" | " # field separator -filename=$(basename "$1") -filesize=$(du -Hh "$1" | cut -f 1) +exec 2>/dev/null -geometry=$(identify -format '%wx%h' "$1[0]") +filename=$(basename -- "$1") +filesize=$(du -Hh -- "$1" | cut -f 1) +geometry="${2}x${3}" -tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }') -tags=${tags%,} - -echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}" +echo "${filesize}${s}${geometry}${s}${filename}" -- cgit v1.3