Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Added documentation for image-info script
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb3rt committed Jan 27, 2013
1 parent cae5358 commit 9c0a53b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 13 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = git-20130112
VERSION = git-20130127

PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
17 changes: 12 additions & 5 deletions image-info
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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 changes: 15 additions & 4 deletions sxiv.1
Original file line number Diff line number Diff line change
@@ -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 ]
Expand Down Expand Up @@ -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/
Expand All @@ -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)

0 comments on commit 9c0a53b

Please sign in to comment.