summaryrefslogtreecommitdiff
path: root/nsxiv/examples/thumb-info
diff options
context:
space:
mode:
authorstkhan <personal@slickd.xyz>2022-05-05 17:32:35 +0000
committerstkhan <personal@slickd.xyz>2022-05-05 17:32:35 +0000
commit42966e3e531b8e46e4ab31480d45aa7a141f19ce (patch)
tree9a5a195e95bed96abb6601992d4e9e9a9634c300 /nsxiv/examples/thumb-info
parent2d4cdb2e921b9ecf74d7569b3e505754d483ef1a (diff)
added config files, and nsxiv
Diffstat (limited to 'nsxiv/examples/thumb-info')
-rwxr-xr-xnsxiv/examples/thumb-info20
1 files changed, 20 insertions, 0 deletions
diff --git a/nsxiv/examples/thumb-info b/nsxiv/examples/thumb-info
new file mode 100755
index 0000000..b422f9c
--- /dev/null
+++ b/nsxiv/examples/thumb-info
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Example for $XDG_CONFIG_HOME/nsxiv/exec/thumb-info
+# Called by nsxiv(1) whenever the selected thumbnail changes.
+# The output is displayed in nsxiv's status bar.
+# Arguments:
+# $1: path to image file (as provided by the user)
+# $2: empty
+# $3: empty
+# $4: fully resolved path to the image file
+
+s=" " # field separator
+
+exec 2>/dev/null
+
+filename=$(basename -- "$4")
+filesize=$(du -Hh -- "$4" | cut -f 1)
+
+echo "${filesize}${s}${filename}"
+