nsxiv9c0a53b
Added documentation for image-info script
+35 −13
4 files changed
- M Makefile +6 −2
- M README.md +2 −2
- M image-info +12 −5
- M sxiv.1 +15 −4
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20130112 | |
| 1 | + | VERSION = git-20130127 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX = /usr/local | |
| 4 | 4 | MANPREFIX = $(PREFIX)/share/man | |
| @@ -32,9 +32,13 @@ install: all | |||
| 32 | 32 | cp sxiv $(DESTDIR)$(PREFIX)/bin/ | |
| 33 | 33 | chmod 755 $(DESTDIR)$(PREFIX)/bin/sxiv | |
| 34 | 34 | 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 | |
| 36 | 36 | 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 | |
| 37 | 40 | ||
| 38 | 41 | uninstall: | |
| 39 | 42 | rm -f $(DESTDIR)$(PREFIX)/bin/sxiv | |
| 40 | 43 | rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1 | |
| 44 | + | rm -rf $(DESTDIR)$(PREFIX)/share/sxiv | |
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | sxiv | |
| 2 | 2 | ==== | |
| 3 | 3 | ||
| 4 | − | **Simple (or small or suckless) X Image Viewer** | |
| 4 | + | **Simple X Image Viewer** | |
| 5 | 5 | ||
| 6 | 6 | sxiv is an alternative to feh and qiv. Its only dependencies besides xlib are | |
| 7 | 7 | imlib2 and giflib. The primary goal for writing sxiv is to create an image | |
| @@ -20,7 +20,7 @@ Features | |||
| 20 | 20 | * Ability to cache thumbnails for fast re-loading | |
| 21 | 21 | * Basic support for multi-frame images | |
| 22 | 22 | * Load all frames from GIF files and play GIF animations | |
| 23 | − | * Display image information in window title | |
| 23 | + | * Display image information in status bar | |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | Screenshots | |
Mode 100755 → 100644
| @@ -1,10 +1,17 @@ | |||
| 1 | 1 | #!/bin/sh | |
| 2 | 2 | ||
| 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. | |
| 5 | 7 | ||
| 6 | − | #geometry=$(identify -format '%wx%h' "$1") | |
| 8 | + | filename=$(basename "$1") | |
| 9 | + | filesize=$(du -h "$1" | cut -f 1) | |
| 7 | 10 | ||
| 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" | |
| 10 | 17 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | .TH SXIV 1 sxiv\-VERSION | |
| 2 | 2 | .SH NAME | |
| 3 | − | sxiv \- Simple (or small or suckless) X Image Viewer | |
| 3 | + | sxiv \- Simple X Image Viewer | |
| 4 | 4 | .SH SYNOPSIS | |
| 5 | 5 | .B sxiv | |
| 6 | 6 | .RB [ \-bcdFfhpqrstvZ ] | |
| @@ -306,6 +306,15 @@ Pan image left. | |||
| 306 | 306 | .TP | |
| 307 | 307 | .B Shift+ScrollDown | |
| 308 | 308 | 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 . | |
| 309 | 318 | .SH THUMBNAIL CACHING | |
| 310 | 319 | To enable thumbnail caching, please make sure to create the directory | |
| 311 | 320 | .I ~/.sxiv/cache/ | |
| @@ -325,17 +334,19 @@ find . \-depth \-type d \-empty ! \-name '.' \-exec rmdir {} \\; | |||
| 325 | 334 | .RE | |
| 326 | 335 | .SH AUTHOR | |
| 327 | 336 | .EX | |
| 328 | − | Bert Muennich <ber.t at gmx.com> | |
| 337 | + | Bert Muennich <be.muennich @ gmail.com> | |
| 329 | 338 | .EE | |
| 330 | 339 | .SH CONTRIBUTORS | |
| 331 | 340 | .EX | |
| 332 | 341 | Bastien Dejean <nihilhill at gmail.com> | |
| 333 | 342 | Dave Reisner <d at falconindy.com> | |
| 334 | 343 | Fung SzeTat <sthorde at gmail.com> | |
| 335 | − | .EX | |
| 344 | + | .EE | |
| 336 | 345 | .SH HOMEPAGE | |
| 337 | − | .TP | |
| 346 | + | .EX | |
| 347 | + | http://muennich.github.com/sxiv | |
| 338 | 348 | https://github.com/muennich/sxiv | |
| 349 | + | .EE | |
| 339 | 350 | .SH SEE ALSO | |
| 340 | 351 | .BR feh (1), | |
| 341 | 352 | .BR qiv (1) | |