aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-12-01 14:10:32 +0100
committerMattias Andrée <maandree@operamail.com>2015-12-01 14:10:32 +0100
commitd925a12a1b8cd56527bcbb5e19358da4c93a5d34 (patch)
tree805449018fabed2368e6c7e76f67de6f1ed83abf
parentupdate dist (diff)
downloadscrotty-1.0.2.tar.gz
scrotty-1.0.2.tar.bz2
scrotty-1.0.2.tar.xz
misc improvements1.0.2
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--.gitignore8
-rw-r--r--COPYING2
-rw-r--r--Makefile89
-rw-r--r--README65
-rw-r--r--doc/info/fdl.texinfo (renamed from info/fdl.texinfo)0
-rw-r--r--doc/info/scrotty.texinfo (renamed from info/scrotty.texinfo)7
-rw-r--r--doc/man/scrotty.1105
-rw-r--r--src/scrotty.c2
8 files changed, 233 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore
index 58f64e9..c56a9f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,14 @@
_/
-bin/
-obj/
+/bin/
+/obj/
\#*\#
.*
!.git*
*~
+*.bak
+*.new
+*.swo
+*.swp
*.o
*.out
*.su
diff --git a/COPYING b/COPYING
index 71cc96c..79aa79c 100644
--- a/COPYING
+++ b/COPYING
@@ -1,5 +1,5 @@
scrotty — Screenshot program for Linux's TTY
-Copyright © 2014 Mattias Andrée (maandree@member.fsf.org)
+Copyright © 2014, 2015 Mattias Andrée (maandree@member.fsf.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/Makefile b/Makefile
index 3b22e82..d2a78e4 100644
--- a/Makefile
+++ b/Makefile
@@ -5,21 +5,25 @@
# The package path prefix, if you want to install to another root, set DESTDIR to that root
-PREFIX ?= /usr
+PREFIX = /usr
# The command path excluding prefix
-BIN ?= /bin
+BIN = /bin
# The resource path excluding prefix
-DATA ?= /share
+DATA = /share
# The command path including prefix
-BINDIR ?= $(PREFIX)$(BIN)
+BINDIR = $(PREFIX)$(BIN)
# The resource path including prefix
-DATADIR ?= $(PREFIX)$(DATA)
+DATADIR = $(PREFIX)$(DATA)
# The generic documentation path including prefix
-DOCDIR ?= $(DATADIR)/doc
+DOCDIR = $(DATADIR)/doc
# The info manual documentation path including prefix
-INFODIR ?= $(DATADIR)/info
+INFODIR = $(DATADIR)/info
+# The man page documentation path including prefix
+MANDIR = $(DATADIR)/man
+# The man page section 1 path including prefix
+MAN1DIR = $(MANDIR)/man1
# The license base path including prefix
-LICENSEDIR ?= $(DATADIR)/licenses
+LICENSEDIR = $(DATADIR)/licenses
# The /dev directory that should be compiled into the program
DEVDIR = /dev
@@ -27,12 +31,12 @@ DEVDIR = /dev
SYSDIR = /sys
# The name of the command as it should be installed
-COMMAND ?= scrotty
+COMMAND = scrotty
# The name of the package as it should be installed
-PKGNAME ?= scrotty
+PKGNAME = scrotty
# Optimisation settings for C code compilation
-OPTIMISE ?= -Og -g
+OPTIMISE = -Og -g
# Warnings settings for C code compilation
WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
-Wtrampolines -Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
@@ -53,10 +57,13 @@ DEFS = -D'DEVDIR="$(DEVDIR)"' -D'SYSDIR="$(SYSDIR)"'
.PHONY: default
-default: cmd info
+default: base info
.PHONY: all
-all: cmd doc
+all: base doc
+
+.PHONY: base
+base: cmd
.PHONY: cmd
cmd: bin/scrotty
@@ -73,34 +80,36 @@ bin/scrotty: obj/scrotty.o
doc: info pdf dvi ps
.PHONY: info
-info: scrotty.info
-%.info: info/%.texinfo info/fdl.texinfo
+info: bin/scrotty.info
+bin/%.info: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p bin
makeinfo $<
+ mv $*.info $@
.PHONY: pdf
-pdf: scrotty.pdf
-%.pdf: info/%.texinfo info/fdl.texinfo
- @mkdir -p obj/pdf
- cd obj/pdf ; yes X | texi2pdf ../../$<
- mv obj/pdf/$@ $@
+pdf: bin/scrotty.pdf
+bin/%.pdf: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p obj/pdf bin
+ cd obj/pdf && texi2pdf ../../$< < /dev/null
+ mv obj/pdf/$*.pdf $@
.PHONY: dvi
-dvi: scrotty.dvi
-%.dvi: info/%.texinfo info/fdl.texinfo
- @mkdir -p obj/dvi
- cd obj/dvi ; yes X | $(TEXI2DVI) ../../$<
- mv obj/dvi/$@ $@
+dvi: bin/scrotty.dvi
+bin/%.dvi: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p obj/dvi bin
+ cd obj/dvi && $(TEXI2DVI) ../../$< < /dev/null
+ mv obj/dvi/$*.dvi $@
.PHONY: ps
-ps: scrotty.ps
-%.ps: info/%.texinfo info/fdl.texinfo
- @mkdir -p obj/ps
- cd obj/ps ; yes X | texi2pdf --ps ../../$<
- mv obj/ps/$@ $@
+ps: bin/scrotty.ps
+bin/%.ps: doc/info/%.texinfo doc/info/fdl.texinfo
+ @mkdir -p obj/ps bin
+ cd obj/ps && texi2pdf --ps ../../$< < /dev/null
+ mv obj/ps/$*.ps $@
.PHONY: install
-install: install-base install-info
+install: install-base install-info install-man
.PHONY: install-all
install-all: install-base install-doc
@@ -127,28 +136,33 @@ install-license:
install -m644 LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
.PHONY: install-doc
-install-doc: install-info install-pdf install-ps install-dvi
+install-doc: install-info install-pdf install-ps install-dvi install-man
.PHONY: install-info
-install-info: scrotty.info
+install-info: bin/scrotty.info
install -dm755 -- "$(DESTDIR)$(INFODIR)"
install -m644 $< -- "$(DESTDIR)$(INFODIR)/$(PKGNAME).info"
.PHONY: install-pdf
-install-pdf: scrotty.pdf
+install-pdf: bin/scrotty.pdf
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf"
.PHONY: install-ps
-install-ps: scrotty.ps
+install-ps: bin/scrotty.ps
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps"
.PHONY: install-dvi
-install-dvi: scrotty.dvi
+install-dvi: bin/scrotty.dvi
install -dm755 -- "$(DESTDIR)$(DOCDIR)"
install -m644 $< -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi"
+.PHONY: install-man
+install-man: doc/man/scrotty.1
+ install -dm755 -- "$(DESTDIR)$(MAN1DIR)"
+ install -m644 $< -- "$(DESTDIR)$(MAN1DIR)/$(COMMAND).1"
+
.PHONY: uninstall
uninstall:
@@ -160,9 +174,10 @@ uninstall:
-rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).pdf"
-rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).ps"
-rm -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME).dvi"
+ -rm -- "$(DESTDIR)$(MAN1DIR)/$(COMMAND).1"
.PHONY: clean
clean:
- -rm -r bin obj scrotty.{info,pdf,ps,dvi} *.su src/*.su
+ -rm -r bin obj
diff --git a/README b/README
index 26a06a0..64844b9 100644
--- a/README
+++ b/README
@@ -1,2 +1,65 @@
-Screenshot program for Linux's TTY.
+NAME
+ scrotty - Screenshot program for Linux's TTY.
+
+SYNOPSIS
+ scrotty [OPTION]... [FILENAME_PATTERN] [-- CONVERT_OPTION...]
+
+DESCRIPTION
+ scrotty is a minimalist screenshoter for the Linux VT. It takes
+ a screenshot of your framebuffers (multiple are supported.)
+ X is not supported.
+
+ scrotty is designed after scrot(1), but includes a some
+ improvements. Namely it does not support delaying the screenshot,
+ selecting image quality or creating thumbnails, but it has
+ support for adding arbitrary arguments to convert(1), which is
+ used to save the image.
+
+OPTIONS
+ --help
+ Print usage information.
+
+ --version
+ Print program name and version.
+
+ --copyright
+ Print copyright information.
+
+ --exec CMD
+ Command to run for each saved image.
+
+SPECIAL STRINGS
+ Both the --exec and FILENAME_PATTERN parameters can take format
+ specifiers that are expanded by scrotty when encountered. There
+ are two types of format specifier. Characters preceded by a '%'
+ are interpretted by strftime(3). These options may be used to
+ refer to the current date and time. The second kind are internal
+ to scrotty and are prefixed by '$' or '\'. The following specifiers
+ are recognised:
+
+ $i framebuffer index
+ $f image filename/pathname (ignored in FILENAME_PATTERN)
+ $n image filename (ignored in FILENAME_PATTERN)
+ $p image width multiplied by image height
+ $w image width
+ $h image height
+ $$ expands to a literal '$'
+ \n expands to a new line
+ \\ expands to a literal '\'
+ \ expands to a literal ' ' (backslash, space)
+
+ A space that is not prefixed by a backslash in --exec is
+ interpreted as an argument delimiter. This is the case even at
+ the beginning and end of the string and if a space was the
+ previous character in the string.
+
+RATIONALE
+ Taking screenshots was a pain before this. Screenshots
+ are useful if you want to remember something or send an
+ image of how something looks.
+
+SEE ALSO
+ scrot(1), convert(1), strftime(3)
+
+ Full documentation available locally via: info '(scrotty)'
diff --git a/info/fdl.texinfo b/doc/info/fdl.texinfo
index cb71f05..cb71f05 100644
--- a/info/fdl.texinfo
+++ b/doc/info/fdl.texinfo
diff --git a/info/scrotty.texinfo b/doc/info/scrotty.texinfo
index 64bde00..6873546 100644
--- a/info/scrotty.texinfo
+++ b/doc/info/scrotty.texinfo
@@ -17,7 +17,7 @@
@copying
-Copyright @copyright{} 2014 Mattias Andrée
+Copyright @copyright{} 2014, 2015 Mattias Andrée
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -41,7 +41,8 @@ Texts. A copy of the license is included in the section entitled
@author by Mattias Andrée (maandree)
@page
-@c @center `'
+@center `I don't know how to make a screenshot, because I normally use my computer in
+@center text-mode. I have @sc{X} and @sc{GNOME} installed, but I use them only occasionally.' --- rms
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@@ -70,7 +71,7 @@ rendered on the framebuffer.}
@command{scrotty} is designed after @command{scrot}, but
includes a some improvements. Namely it does not support
delaying the screenshot, selecting image quality or creating
-thumbnails, but it as supports for adding arbitrary arguments
+thumbnails, but it has support for adding arbitrary arguments
to @command{convert} (from the ImageMagick project), which is
used to save the image.
diff --git a/doc/man/scrotty.1 b/doc/man/scrotty.1
new file mode 100644
index 0000000..7f592ac
--- /dev/null
+++ b/doc/man/scrotty.1
@@ -0,0 +1,105 @@
+.TH SCROTTY 1 SCROTTY
+.SH NAME
+scrotty \- Screenshot program for Linux's TTY.
+.SH SYNOPSIS
+.B scrotty
+.RI [ OPTION ]...\ [ FILENAME_PATTERN ]
+[\-\-
+.IR CONVERT_OPTION ...]
+.SH DESCRIPTION
+.B scrotty
+is a minimalist screenshoter for the
+.BR Linux\ VT .
+It takes a screenshot of your framebuffers (multiple are
+supported.)
+.B X
+is not supported.
+.PP
+.B scrotty
+is designed after
+.BR scrot (1),
+but includes a some improvements. Namely it does not support
+delaying the screenshot, selecting image quality or creating
+thumbnails, but it has support for adding arbitrary arguments
+to
+.BR convert (1),
+which is used to save the image.
+.SH OPTIONS
+.TP
+.B \-\-help
+Print usage information.
+.TP
+.B \-\-version
+Print program name and version.
+.TP
+.B \-\-copyright
+Print copyright information.
+.TP
+.BR \-\-exec \ \fICMD\fP
+Command to run for each saved image.
+.SH "SPECIAL STRINGS"
+Both the
+.B \-\-exec
+and
+.I FILENAME_PATTERN
+parameters can take format specifiers that are expanded by
+.B scrotty
+when encountered. There are two types of format specifier.
+Characters preceded by a \(aq%\(aq are interpretted by
+.BR strftime (3).
+These options may be used to refer to the current date and
+time. The second kind are internal to
+.B scrotty
+and are prefixed by \(aq$\(aq or \(aq\\\(aq. The following
+specifiers are recognised:
+.PP
+$i framebuffer index
+.br
+$f image filename/pathname (ignored in FILENAME_PATTERN)
+.br
+$n image filename (ignored in FILENAME_PATTERN)
+.br
+$p image width multiplied by image height
+.br
+$w image width
+.br
+$h image height
+.br
+$$ expands to a literal \(aq$\(aq
+.br
+\\n expands to a new line
+.br
+\\\\ expands to a literal \(aq\\\(aq
+.br
+\\ expands to a literal \(aq \(aq (backslash, space)
+.PP
+A space that is not prefixed by a backslash in
+.B \-\-exec
+is interpreted as an argument delimiter. This is the case
+even at the beginning and end of the string and if a space
+was the previous character in the string.
+.SH RATIONALE
+Taking screenshots was a pain before this. Screenshots
+are useful if you want to remember something or send an
+image of how something looks.
+.SH "SEE ALSO"
+.BR scrot (1),
+.BR convert (1),
+.BR strftime (3)
+.PP
+Full documentation available locally via: info \(aq(scrotty)\(aq
+.SH AUTHORS
+Principal author, Mattias Andrée. See the COPYING file for the full
+list of authors.
+.SH LICENSE
+Copyright \(co 2014, 2015 Mattias Andrée
+.br
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+.br
+This is free software: you are free to change and redistribute it.
+.br
+There is NO WARRANTY, to the extent permitted by law.
+.SH BUGS
+Please report bugs to https://github.com/maandree/scrotty/issues or to
+maandree@member.fsf.org
+
diff --git a/src/scrotty.c b/src/scrotty.c
index 16aebbb..0f690f3 100644
--- a/src/scrotty.c
+++ b/src/scrotty.c
@@ -533,7 +533,7 @@ static int print_help(void)
p("SPECIAL STRINGS\n");
p("\tBoth the --exec and filename-pattern parameters can take format specifiers\n");
p("\tthat are expanded by scrotty when encountered. There are two types of format\n");
- p("\tspecifier. Characters preceded by a '%%' are interpretted by strftime(2).\n");
+ p("\tspecifier. Characters preceded by a '%%' are interpretted by strftime(3).\n");
p("\tSee `man strftime` for examples. These options may be used to refer to the\n");
p("\tcurrent date and time. The second kind are internal to scrotty and are prefixed\n");
p("\tby '$' or '\\'. The following specifiers are recognised:\n");