aboutsummaryrefslogtreecommitdiff
path: root/nsxiv/.config
diff options
context:
space:
mode:
authordavidpkj <davidpenkow1@gmail.com>2023-08-27 16:32:21 +0200
committerdavidpkj <davidpenkow1@gmail.com>2023-08-27 16:32:21 +0200
commit30c436b7f35133c808eb34e9425e6df592f2a027 (patch)
treedc1991197fbb65bf1a8cebb53a4218ecf3fcf80c /nsxiv/.config
parent8bb5e75602fd5b7c2eb17fb863b68000b13a65ec (diff)
Update to current general style
Diffstat (limited to 'nsxiv/.config')
-rwxr-xr-xnsxiv/.config/nsxiv/exec/image-info19
1 files changed, 19 insertions, 0 deletions
diff --git a/nsxiv/.config/nsxiv/exec/image-info b/nsxiv/.config/nsxiv/exec/image-info
new file mode 100755
index 0000000..0e22bb0
--- /dev/null
+++ b/nsxiv/.config/nsxiv/exec/image-info
@@ -0,0 +1,19 @@
+#!/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.
+geometry=$(identify -format '%wx%h' "$1[0]")
+
+tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }')
+tags=${tags%,}
+
+echo "${filesize}${s}${geometry}${tags:+$s}${tags}${s}${filename}"