Krolyxon
Commit 9c0a53b

Branches

Refs →

nsxiv9c0a53b

Added documentation for image-info script

Author
Bert Münnich
Date
2013-01-27 18:03 +0100
Parent
cae5358
Commit
9c0a53bc34c53424613ee203253fee526ba9f049

+35 −13

4 files changed

  1. M Makefile +6 −2
  2. M README.md +2 −2
  3. M image-info +12 −5
  4. M sxiv.1 +15 −4
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20130112
1+VERSION = git-20130127
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
@@ -32,9 +32,13 @@ install: all
3232 cp sxiv $(DESTDIR)$(PREFIX)/bin/
3333 chmod 755 $(DESTDIR)$(PREFIX)/bin/sxiv
3434 mkdir -p $(DESTDIR)$(MANPREFIX)/man1
35− sed "s/VERSION/$(VERSION)/g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
35+ sed "s!PREFIX!$(PREFIX)!g; s!VERSION!$(VERSION)!g" sxiv.1 > $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
3636 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
37+ mkdir -p $(DESTDIR)$(PREFIX)/share/sxiv/exec
38+ cp image-info $(DESTDIR)$(PREFIX)/share/sxiv/exec/image-info
39+ chmod 755 $(DESTDIR)$(PREFIX)/share/sxiv/exec/image-info
3740
3841 uninstall:
3942 rm -f $(DESTDIR)$(PREFIX)/bin/sxiv
4043 rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1
44+ rm -rf $(DESTDIR)$(PREFIX)/share/sxiv
M README.md View
@@ -1,7 +1,7 @@
11 sxiv
22 ====
33
4−**Simple (or small or suckless) X Image Viewer**
4+**Simple X Image Viewer**
55
66 sxiv is an alternative to feh and qiv. Its only dependencies besides xlib are
77 imlib2 and giflib. The primary goal for writing sxiv is to create an image
@@ -20,7 +20,7 @@ Features
2020 * Ability to cache thumbnails for fast re-loading
2121 * Basic support for multi-frame images
2222 * Load all frames from GIF files and play GIF animations
23−* Display image information in window title
23+* Display image information in status bar
2424
2525
2626 Screenshots
M image-info View

Mode 100755 → 100644

@@ -1,10 +1,17 @@
11 #!/bin/sh
22
3−#filename=$1
4−#filesize=$(du -h "$1")
3+# Example for ~/.sxiv/exec/image-info
4+# Called by sxiv(1) whenever an image gets loaded,
5+# with the name of the image file as its first argument.
6+# The output is displayed in sxiv's status bar.
57
6−#geometry=$(identify -format '%wx%h' "$1")
8+filename=$(basename "$1")
9+filesize=$(du -h "$1" | cut -f 1)
710
8−#tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" {print $4","}')
9−#tags=${tags%,}
11+geometry=$(identify -format '%wx%h' "$1")
12+
13+tags=$(exiv2 -q pr -pi "$1" | awk '$1~"Keywords" { printf("%s,", $4); }')
14+tags=${tags:+|}${tags%,}
15+
16+echo "[$filesize|$geometry$tags] $filename"
1017
M sxiv.1 View
@@ -1,6 +1,6 @@
11 .TH SXIV 1 sxiv\-VERSION
22 .SH NAME
3−sxiv \- Simple (or small or suckless) X Image Viewer
3+sxiv \- Simple X Image Viewer
44 .SH SYNOPSIS
55 .B sxiv
66 .RB [ \-bcdFfhpqrstvZ ]
@@ -306,6 +306,15 @@ Pan image left.
306306 .TP
307307 .B Shift+ScrollDown
308308 Pan image right.
309+.SH STATUS BAR
310+The information displayed on the left side of the status bar can be replaced
311+with the output of a user-provided script, which is called by sxiv whenever an
312+image gets loaded. The path of this script is
313+.I ~/.sxiv/exec/image-info
314+and the first argument to this script is the path of the loaded image.
315+.P
316+There is also an example script installed together with sxiv as
317+.IR PREFIX/share/sxiv/exec/image-info .
309318 .SH THUMBNAIL CACHING
310319 To enable thumbnail caching, please make sure to create the directory
311320 .I ~/.sxiv/cache/
@@ -325,17 +334,19 @@ find . \-depth \-type d \-empty ! \-name '.' \-exec rmdir {} \\;
325334 .RE
326335 .SH AUTHOR
327336 .EX
328−Bert Muennich <ber.t at gmx.com>
337+Bert Muennich <be.muennich @ gmail.com>
329338 .EE
330339 .SH CONTRIBUTORS
331340 .EX
332341 Bastien Dejean <nihilhill at gmail.com>
333342 Dave Reisner <d at falconindy.com>
334343 Fung SzeTat <sthorde at gmail.com>
335−.EX
344+.EE
336345 .SH HOMEPAGE
337−.TP
346+.EX
347+http://muennich.github.com/sxiv
338348 https://github.com/muennich/sxiv
349+.EE
339350 .SH SEE ALSO
340351 .BR feh (1),
341352 .BR qiv (1)