diff options
| author | katherine <ageha@airen-no-jikken.icu> | 2026-07-23 17:08:37 +1000 |
|---|---|---|
| committer | katherine <ageha@airen-no-jikken.icu> | 2026-07-23 17:08:37 +1000 |
| commit | cd25808c26c23539bee780ed9c5f312174b9c47f (patch) | |
| tree | da85fe7fb474dd94f30c3981db2f82187af9533d /.config/sxiv/exec/image-info | |
| parent | ecb94b607113a8787c6abf0319a43f1158c06e59 (diff) | |
| download | dotfiles-cd25808c26c23539bee780ed9c5f312174b9c47f.tar.gz | |
update sxiv handlers
Diffstat (limited to '.config/sxiv/exec/image-info')
| -rwxr-xr-x | .config/sxiv/exec/image-info | 24 |
1 files changed, 13 insertions, 11 deletions
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}" |
