aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2021-02-13 13:17:44 -0300
committerSilvio Rhatto <rhatto@riseup.net>2021-02-13 13:17:44 -0300
commit0f985c6acea52db5ba6cd738692bb9b7ee9e3eef (patch)
tree6d01c37a9848e02f86e219b7a19d9a1e1c3bcfda
parent2f12b3754e9d42cc77dc3e632d9bdbb8371b40a0 (diff)
downloadscripts-0f985c6acea52db5ba6cd738692bb9b7ee9e3eef.tar.gz
scripts-0f985c6acea52db5ba6cd738692bb9b7ee9e3eef.tar.bz2
Adds gallery wrapper
-rwxr-xr-xgallery22
1 files changed, 22 insertions, 0 deletions
diff --git a/gallery b/gallery
new file mode 100755
index 0000000..45e46eb
--- /dev/null
+++ b/gallery
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Image galleries: a wrapper for sxiv(1).
+#
+
+# Parameters
+BASENAME="`basename $0`"
+IMAGES="$HOME/data/images"
+GALLERY="${1:-$IMAGES}"
+
+# Check
+if [ "$GALLERY" != "-" ] && [ ! -d "$GALLERY" ]; then
+ echo "$BASENAME: path not found: $GALLERY"
+ exit 1
+elif ! which sxiv &> /dev/null; then
+ echo "$BASENAME: please install sxiv"
+ exit 1
+fi
+
+# Dispatch
+# Option -o allows piping the selection output to other tools
+sxiv -t -q -b -o -r $GALLERY 2> /dev/null