diff options
| author | Sylvain Herlédan <sylvain.herledan@hrafnagud.info> | 2017-06-03 15:51:13 +0200 |
|---|---|---|
| committer | Sylvain Herlédan <sylvain.herledan@hrafnagud.info> | 2017-06-03 15:51:13 +0200 |
| commit | 67c379658432bca5a13eb0f3dcd8f1db16a54f20 (patch) | |
| tree | 95988dc5b011673c846c8d414b799f6f308e1db1 /bin/image-info.sh | |
| parent | e33ad4f128fb8fef2119cf2c71371eaf9c19bd29 (diff) | |
| download | dotfiles-67c379658432bca5a13eb0f3dcd8f1db16a54f20.tar.gz dotfiles-67c379658432bca5a13eb0f3dcd8f1db16a54f20.tar.bz2 dotfiles-67c379658432bca5a13eb0f3dcd8f1db16a54f20.zip | |
Add sxiv installation.
Diffstat (limited to 'bin/image-info.sh')
| -rwxr-xr-x | bin/image-info.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/image-info.sh b/bin/image-info.sh new file mode 100755 index 0000000..fb2664b --- /dev/null +++ b/bin/image-info.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Example for ~/.config/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. + +s=" | " # field separator + +filename=$(basename "$1") +filesize=$(du -Hh "$1" | cut -f 1) + +# The '[0]' stands for the first frame of a multi-frame file, e.g. gif. +# Requires imagemagick +geometry=$(identify -format '%wx%h' "$1[0]") + +tags="" +# Requires exiv2 +#tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }') +#tags=${tags%,} + +echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}" + |
