Added documentation for image-info script

This commit is contained in:
Bert Münnich 2013-01-27 18:03:01 +01:00
parent cae5358234
commit 9c0a53bc34
4 changed files with 35 additions and 13 deletions

View file

@ -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

View file

@ -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

17
image-info Executable file → Normal file
View file

@ -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"

19
sxiv.1
View file

@ -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)