summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBert Münnich <be.muennich@gmail.com>2013-01-27 18:03:01 +0100
committerBert Münnich <be.muennich@gmail.com>2013-01-27 18:03:01 +0100
commit9c0a53bc34c53424613ee203253fee526ba9f049 (patch)
treea2117056c6bf3c5fc73d5f7139b9dac7e6023cb0
parentcae5358234ecfe6a3fd3c5bad29a0a9f032888a9 (diff)
downloadnsxiv-9c0a53bc34c53424613ee203253fee526ba9f049.tar.zst
Added documentation for image-info script
-rw-r--r--Makefile8
-rw-r--r--README.md4
-rw-r--r--[-rwxr-xr-x]image-info17
-rw-r--r--sxiv.119
4 files changed, 35 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 9d3afd3..d542281 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = git-20130112
+VERSION = git-20130127
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
@@ -32,9 +32,13 @@ install: all
cp sxiv $(DESTDIR)$(PREFIX)/bin/
chmod 755 $(DESTDIR)$(PREFIX)/bin/sxiv
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
- sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
+ sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
+ mkdir -p $(DESTDIR)$(PREFIX)/share/sxiv/exec
+ cp image-info $(DESTDIR)$(PREFIX)/share/sxiv/exec/image-info
+ chmod 755 $(DESTDIR)$(PREFIX)/share/sxiv/exec/image-info
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
+ rm -rf $(DESTDIR)$(PREFIX)/share/sxiv
diff --git a/README.md b/README.md
index a564bb4..d8c1c7a 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
sxiv
====
-**Simple (or small or suckless) X Image Viewer**
+**Simple X Image Viewer**
sxiv is an alternative to feh and qiv. Its only dependencies besides xlib are
imlib2 and giflib. The primary goal for writing sxiv is to create an image
@@ -20,7 +20,7 @@ Features
* Ability to cache thumbnails for fast re-loading
* Basic support for multi-frame images
* Load all frames from GIF files and play GIF animations
-* Display image information in window title
+* Display image information in status bar
Screenshots
diff --git a/image-info b/image-info
index e65e06a..3c03a3f 100755..100644
--- a/image-info
+++ b/image-info
@@ -1,10 +1,17 @@
#!/bin/sh
-#filename=$1
-#filesize=$(du -h "$1")
+# Example for ~/.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.
-#geometry=$(identify -format '%wx%h' "$1")
+filename=$(basename "$1")
+filesize=$(du -h "$1" | cut -f 1)
-#tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" {print $4","}')
-#tags=${tags%,}
+geometry=$(identify -format '%wx%h' "$1")
+
+tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }')
+tags=${tags:+|}${tags%,}
+
+echo "[$filesize|$geometry$tags] $filename"
diff --git a/sxiv.1 b/sxiv.1
index b963a17..6f61561 100644
--- a/sxiv.1
+++ b/sxiv.1
@@ -1,6 +1,6 @@
.TH SXIV 1 sxiv\-VERSION
.SH NAME
-sxiv \- Simple (or small or suckless) X Image Viewer
+sxiv \- Simple X Image Viewer
.SH SYNOPSIS
.B sxiv
.RB [ \-bcdFfhpqrstvZ ]
@@ -306,6 +306,15 @@ Pan image left.
.TP
.B Shift+ScrollDown
Pan image right.
+.SH STATUS BAR
+The information displayed on the left side of the status bar can be replaced
+with the output of a user-provided script, which is called by sxiv whenever an
+image gets loaded. The path of this script is
+.I ~/.sxiv/exec/image-info
+and the first argument to this script is the path of the loaded image.
+.P
+There is also an example script installed together with sxiv as
+.IR PREFIX/share/sxiv/exec/image-info .
.SH THUMBNAIL CACHING
To enable thumbnail caching, please make sure to create the directory
.I ~/.sxiv/cache/
@@ -325,17 +334,19 @@ find . \-depth \-type d \-empty ! \-name '.' \-exec rmdir {} \\;
.RE
.SH AUTHOR
.EX
-Bert Muennich <ber.t at gmx.com>
+Bert Muennich <be.muennich @ gmail.com>
.EE
.SH CONTRIBUTORS
.EX
Bastien Dejean <nihilhill at gmail.com>
Dave Reisner <d at falconindy.com>
Fung SzeTat <sthorde at gmail.com>
-.EX
+.EE
.SH HOMEPAGE
-.TP
+.EX
+http://muennich.github.com/sxiv
https://github.com/muennich/sxiv
+.EE
.SH SEE ALSO
.BR feh (1),
.BR qiv (1)