commit cbfe79582063fad4613a0e0f90057d78e12a2902
parent 8091d61acc1f5c39a01ad33d2a5ed08033231c67
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sun, 18 Apr 2021 21:00:31 -0700
Update Makefile and man page
- Remove the now redundent lel-open script
- Update the options, keybinds, and authors in the manual
- Remove calls to chmod(1) and mkdir(1) in the Makefile
- Don't suppress make(1) from listing the commands run
Diffstat:
M | Makefile | | | 38 | ++++++++++---------------------------- |
D | lel-open | | | 27 | --------------------------- |
M | lel.1 | | | 112 | ++++++++++++++++++++++++++++++++----------------------------------------------- |
3 files changed, 55 insertions(+), 122 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,45 +1,27 @@
include config.mk
NAME = lel
-SRC = lel.c
-OBJ = ${SRC:.c=.o}
+OBJ = lel.o
-all: lel
-
-options:
- @echo ${NAME} build options:
- @echo "CFLAGS = ${CFLAGS}"
- @echo "LDFLAGS = ${LDFLAGS}"
- @echo "CC = ${CC}"
+all: ${NAME}
.c.o:
${CC} -c ${CFLAGS} $<
${OBJ}: config.mk
-lel: lel.o
- ${CC} -o $@ lel.o ${LDFLAGS}
+${NAME}: ${OBJ}
+ ${CC} -o $@ ${OBJ} ${LDFLAGS}
clean:
- rm -f lel ${OBJ}
+ rm -f ${NAME} ${OBJ}
install: all
- @echo installing executable file to ${DESTDIR}${PREFIX}/bin
- @mkdir -p ${DESTDIR}${PREFIX}/bin
- @cp -f lel ${DESTDIR}${PREFIX}/bin
- @cp -f lel-open ${DESTDIR}${PREFIX}/bin
- @chmod 755 ${DESTDIR}${PREFIX}/bin/lel
- @chmod 755 ${DESTDIR}${PREFIX}/bin/lel-open
- @echo installing manual pages to ${DESTDIR}${MANPREFIX}/man1
- @mkdir -p ${DESTDIR}${MANPREFIX}/man1
- @cp -f lel.1 ${DESTDIR}${MANPREFIX}/man1
- @chmod 644 ${DESTDIR}${MANPREFIX}/man1/lel.1
+ cp -f ${NAME} ${PREFIX}/bin
+ cp -f ${NAME}.1 ${MANPREFIX}/man1
uninstall:
- @echo removing executable file from ${DESTDIR}${PREFIX}/bin
- @rm -f ${DESTDIR}${PREFIX}/bin/lel
- @rm -f ${DESTDIR}${PREFIX}/bin/lel-open
- @echo removing manual pages from ${DESTDIR}${MANPREFIX}/man1
- @rm -f ${DESTDIR}${MANPREFIX}/man1/lel.1
+ rm -f ${PREFIX}/bin/${NAME}
+ rm -f ${MANPREFIX}/man1/${NAME}.1
-.PHONY: all options clean dist install uninstall
+.PHONY: all clean install uninstall
diff --git a/lel-open b/lel-open
@@ -1,27 +0,0 @@
-#!/bin/sh
-filename="$1"
-shift
-ext=$(basename "$filename" | grep -o '\..[^\.]*$')
-convert=""
-
-if test x"$ext" = x".jpg"; then
- convert="jpg2ff"
-elif test x"$ext" = x".png"; then
- convert="png2ff"
-elif test x"$ext" = x".gif"; then
- convert="gif2ff"
-elif test x"$ext" = x".ff"; then
- convert="cat"
-elif test x"$ext" = x".bz2"; then
- convert="bzip2 -dc"
-elif test x"$ext" = x".gz"; then
- convert="gzip -dc"
-elif test x"$ext" = x".xz"; then
- convert="xz -dc"
-else
- echo "unknown extension \"$ext\"" >&2
-fi
-
-if test x"$convert" != x""; then
- $convert < "$filename" | lel -t "$filename" "$@"
-fi
diff --git a/lel.1 b/lel.1
@@ -6,12 +6,7 @@
.Nd simple X11 image viewer
.Sh SYNOPSIS
.Nm
-.Op Fl afv
-.Op Fl h Ar height
-.Op Fl w Ar width
-.Op Fl t Ar title
-.Op Fl x Ar position
-.Op Fl y Ar position
+.Op Fl f
.Op Ar
.Sh DESCRIPTION
The
@@ -22,73 +17,48 @@ format.
.Pp
The options are as follows:
.Bl -tag -width Ds
-.It Fl a
-Display full window, keep aspect ratio.
.It Fl f
-Display full window, stretch (no aspect).
-.It Fl v
-Print version and exit.
-.It Fl h
-Set window height to
-.Ar height .
-.It Fl w
-Set window width to
-.Ar width .
-.It Fl t
-Set window title to
-.Ar title .
-.It Fl x
-Set window X position to
-.Ar position .
-.It Fl y
-Set window Y position to
-.Ar position .
-.It Ar file
-Read input from zero or more files.
-If unspecified, reads from stdin.
-If multiple files are specified,
-.Nm
-will halt with the first failed parse.
+Fit image.
.El
.Sh COMMANDS
.Bl -tag -width Ds
-.It Ic RETURN
-Print to stdout title.
-.It Ic ESC | q
+.It Ic q, Escape
Quit
.Nm .
-.It Ic LEFTARROW | h
-Scroll horizontally left.
-.It Ic RIGHTARROW | l
-Scroll horizontally right.
-.It Ic DOWNARROW | j
-Scroll vertically down.
-.It Ic UPARROW | k
-Scroll vertically up.
-.It Ic a
-Set full aspect ratio.
-.It Ic o
-Set aspect ratio.
-.It Ic f
-Stretch (no aspect).
+.It Ic h, Left
+Scroll left.
+.It Ic l, Right
+Scroll right.
+.It Ic j, Down
+Scroll down.
+.It Ic k, Up
+Scroll up.
+.It Ic i, Equals, Plus
+Zoom in.
+.It Ic o, Underscore, Minus
+Zoom out.
+.It Ic 0
+Reset zoom level, set aspect ratio, and reload image.
+.It Ic r
+Reload image.
.It Ic n
Go to the next image.
.It Ic p
Go to the previous image.
-.It Ic r
-Reload image.
-.It Ic = | +
-Zoom in.
-.It Ic _ | -
-Zoom out.
-.It Ic 0
-Set zoom level to 100%; set aspect ratio, and reload image.
-.It Ic 1
-Set zoom level to 100%.
-.It Ic 2
-Set zoom level to 200%.
-.It Ic 3
-Set zoom level to 400%.
+.It Ic a
+Full aspect ratio.
+.It Ic s
+Stretch image.
+.It Ic d
+Full view.
+.It Ic f
+Fit image.
+.It Ic w
+Fit image width.
+.It Ic e
+Fit image height.
+.It Ic Return
+Print file to stdout.
.El
.Sh MOUSE COMMANDS
.Bl -tag -width Ds
@@ -100,11 +70,19 @@ Zoom down.
.Sh EXIT STATUS
.Ex -std
.Sh AUTHORS
-.An -nosplit
.Nm
-was written by
+.An -nosplit
+was originally written by
.An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
and
.An sin Aq Mt sin@2f30.org .
-Manual page was written by
-.An Svyatoslav Mishyn Aq Mt juef@openmailbox.org .
+This is a fork of
+.Nm
+by
+.An
+.An Jacob Edwards .
+.Pp
+The manual page was written by
+.An Svyatoslav Mishyn Aq Mt juef@openmailbox.org
+and was rewritten by
+.An Jacob Edwards .