aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--doc/meh.135
-rw-r--r--src/xlib.c2
3 files changed, 40 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 0e3a5dd..40fed53 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,8 @@ CLEANFILES := $(CLEANFILES) $(DEPFILES) $(OBJFILES) test/test.o test/test.d test
LIBS ?= -lX11 -lXext -ljpeg -lpng -lgif
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
+DATAROOTDIR = $(PREFIX)/share
+MANDIR = $(DATAROOTDIR)/man
# User configuration
CONFIG ?= ../config
@@ -32,7 +34,8 @@ test/test: test/test.o $(filter-out src/main.o src/xlib.o, $(OBJFILES))
$(CC) $(CFLAGS) -MMD -MP -MT "$*.d" -c -o $@ $<
install:
- install -Dm 755 meh $(BINDIR)
+ install -Dm 755 meh $(DESTDIR)$(BINDIR)/meh
+ install -D doc/meh.1 $(DESTDIR)$(MANDIR)/man1/meh.1
# Clean
clean:
diff --git a/doc/meh.1 b/doc/meh.1
new file mode 100644
index 0000000..5d5ba85
--- /dev/null
+++ b/doc/meh.1
@@ -0,0 +1,35 @@
+.TH MEH 1 "2013-12-28"
+.SH NAME
+meh \- simple, minimalist, super fast image viewer
+.SH SYNOPSIS
+.B meh
+.IR FILE ...
+.br
+.B meh \-list
+.RI [ LISTFILE ]
+.br
+.B meh \-ctl
+.br
+.B meh \-v
+.SH DESCRIPTION
+.B meh
+is a small, simple, super fast image viewer using raw XLib.
+It is similar to
+.BR feh (1),
+but faster and simpler.
+.LP
+.B meh
+can use ImageMagick's
+.BR convert (1)
+to view almost 200 file formats, though it is slower for these formats.
+Built-in formats are JPEG, PNG, BMP, and netpbm.
+.SH OPTIONS
+.TP
+.BR \-list \ [\fILISTFILE\fR]
+Treat \fILISTFILE\fR as list of images. Defaults to stdin.
+.TP
+.B \-ctl
+Display files as they are received on stdin.
+.TP
+.B \-v
+Print version and exit.
diff --git a/src/xlib.c b/src/xlib.c
index fc6895d..2912321 100644
--- a/src/xlib.c
+++ b/src/xlib.c
@@ -173,8 +173,8 @@ static int xquit(Display *d){
void backend_init(){
display = XOpenDisplay (NULL);
- xfd = ConnectionNumber(display);
assert(display);
+ xfd = ConnectionNumber(display);
screen = DefaultScreen(display);
window = XCreateWindow(display, DefaultRootWindow(display), 0, 0, 640, 480, 0, DefaultDepth(display, screen), InputOutput, CopyFromParent, 0, NULL);