aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSylvain Herlédan <sylvain.herledan@hrafnagud.info>2017-06-03 15:51:13 +0200
committerSylvain Herlédan <sylvain.herledan@hrafnagud.info>2017-06-03 15:51:13 +0200
commit67c379658432bca5a13eb0f3dcd8f1db16a54f20 (patch)
tree95988dc5b011673c846c8d414b799f6f308e1db1 /bin
parente33ad4f128fb8fef2119cf2c71371eaf9c19bd29 (diff)
downloaddotfiles-67c379658432bca5a13eb0f3dcd8f1db16a54f20.tar.gz
dotfiles-67c379658432bca5a13eb0f3dcd8f1db16a54f20.tar.bz2
dotfiles-67c379658432bca5a13eb0f3dcd8f1db16a54f20.zip
Add sxiv installation.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/image-info.sh23
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}"
+