From 4a8d490cc62902672969bd2750bb0c0a66064a4a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 22 Mar 2014 08:03:59 +0100 Subject: m + list examples in info manual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 21 ++++---- TODO | 1 - examples/battery | 2 +- examples/icc-profile-atoms | 2 +- examples/modes | 10 ++-- examples/threaded | 2 +- examples/weather | 2 +- examples/xmonad | 4 +- info/blueshift.texinfo | 122 +++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 146 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index f6aa9de..71860c4 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,7 @@ obj/%.c: src/%.pyx # Build rules for Python source files bin/blueshift: obj/blueshift.zip - echo '#!/usr/bin/python3' > $@ + echo '#!$(SHEBANG)' > $@ cat $< >> $@ chmod a+x $@ @@ -144,29 +144,32 @@ obj/%.py: src/%.py .PHONY: doc doc: info pdf dvi ps +obj/%.texinfo: info/%.texinfo + @mkdir -p obj + cp $< $@ + sed -i 's:@set DOCDIR /usr/share/doc:@set DOCDIR $(DOCDIR):g' $@ + sed -i 's:@set PKGNAME blueshift:@set PKGNAME $(PKGNAME):g' $@ + .PHONY: info info: blueshift.info -%.info: info/%.texinfo - makeinfo "$<" +%.info: obj/%.texinfo obj/fdl.texinfo + makeinfo $< .PHONY: pdf pdf: blueshift.pdf -%.pdf: info/%.texinfo - @mkdir -p obj +%.pdf: obj/%.texinfo obj/fdl.texinfo cd obj ; yes X | texi2pdf ../$< mv obj/$@ $@ .PHONY: dvi dvi: blueshift.dvi -%.dvi: info/%.texinfo - @mkdir -p obj +%.dvi: obj/%.texinfo obj/fdl.texinfo cd obj ; yes X | $(TEXI2DVI) ../$< mv obj/$@ $@ .PHONY: ps ps: blueshift.ps -%.ps: info/%.texinfo - @mkdir -p obj +%.ps: obj/%.texinfo obj/fdl.texinfo cd obj ; yes X | texi2pdf --ps ../$< mv obj/$@ $@ diff --git a/TODO b/TODO index 0c966e9..e8c5608 100644 --- a/TODO +++ b/TODO @@ -3,7 +3,6 @@ High priority: Add models for calculating fade and refresh rate parameters Medium priority: - Document examples in info manual Low priority: Add a section in manual for information on which order diff --git a/examples/battery b/examples/battery index 5665f3e..4f333f4 100644 --- a/examples/battery +++ b/examples/battery @@ -1,7 +1,7 @@ # -*- python -*- # This is a small example that inverts the colours when the -# batteries capacity is low. +# battery's capacity is low. # Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) diff --git a/examples/icc-profile-atoms b/examples/icc-profile-atoms index a5f5a13..88e57c3 100644 --- a/examples/icc-profile-atoms +++ b/examples/icc-profile-atoms @@ -1,6 +1,6 @@ # -*- python -*- -# This example demonstrates how to use read and +# This example demonstrates how to read and # use the _ICC_PROFILE(_n) atoms for X screens. diff --git a/examples/modes b/examples/modes index 8cac965..e1501b0 100644 --- a/examples/modes +++ b/examples/modes @@ -1,11 +1,11 @@ # -*- python -*- # This example can be used to name a mode you want to use, -# and load the script, without having the use Blueshift's -c -# option and give a pathname. You will only need to give a -# filename. In this example, those modes are installed in -# the directory `$XDG_CONFIG_HOME/blueshift-modes`, and the -# default mode is named `default`. +# without having to use Blueshift's -c option and give a +# pathname. You will only need to give a filename. In this +# example, those modes are installed in the directory +# `$XDG_CONFIG_HOME/blueshift-modes`, and the default mode +# is named `default`. # Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) diff --git a/examples/threaded b/examples/threaded index 827fcd5..74a7c8f 100644 --- a/examples/threaded +++ b/examples/threaded @@ -1,7 +1,7 @@ # -*- python -*- # This example demonstrates how you can make a -# multithreaded configurations script +# multithreaded configurations script. # This file is dual-licensed under GNU General Public License diff --git a/examples/weather b/examples/weather index 5291fb6..18bc923 100644 --- a/examples/weather +++ b/examples/weather @@ -1,7 +1,7 @@ # -*- python -*- # This example demonstrates how to include weather conditions -# in you configuration scripts. +# in your configuration scripts. # Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) diff --git a/examples/xmonad b/examples/xmonad index 8e62a90..3a4cd23 100644 --- a/examples/xmonad +++ b/examples/xmonad @@ -1,7 +1,9 @@ # -*- python -*- # This configuration scripts read the xmonad log to detect -# which workspace you are viewing. +# which workspace you are viewing. It can also disable +# adjustments when you are in selected programs such as +# The GIMP and Inkscape. # Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) diff --git a/info/blueshift.texinfo b/info/blueshift.texinfo index d584601..cfb8cf9 100644 --- a/info/blueshift.texinfo +++ b/info/blueshift.texinfo @@ -9,6 +9,11 @@ @finalout @c %**end of header +@c --- start of do not touch --- +@set DOCDIR /usr/share/doc +@set PKGNAME blueshift +@c --- end of do not touch --- + @dircategory Ergonomy @direntry @@ -57,6 +62,7 @@ Texts. A copy of the license is included in the section entitled * Invoking:: Invocation of @command{blueshift}. * Signals:: Signals handled by @command{blueshift}. * Configuration API:: How to write configuration files. +* Configuration examples:: Example configuration files. * Related software:: Software related to @command{blueshift}. * Terminology:: Related terminology. * GNU Free Documentation License:: Copying and sharing this manual. @@ -1475,6 +1481,122 @@ by invoking them. +@node Configuration examples +@chapter Configuration examples + +The Blueshift packages comes with a set of example +configuration scripts. These are installed to +@file{@value{DOCDIR}/@value{PKGNAME}/examples}. +These examples include: + +@table @file +@item backlight +This example demonstrates how to use adjust backlight +without interfering to much with manual adjustments. +The example with oscillate the backlight between 50 % +and 100 % but include any manual adjustments. + +@item battery +This is a small example that inverts the colours when +the battery's capacity is low. It includes very little +from the configuration API but uses Linux's sysfs to +determine the battery's capacity an charging status. + +@item comprehensive +This example includes most of Blueshift's features and +lets you use them very generically. It does include all +basic features of Blueshift. + +@item crtc-detection +This is a small example that identifies which monitors +you have plugged in to the computer, and applied their +proper calibration. + +@item crtc-searching +This example uses option parsing and CRTC searching. +@command{Screens.find_by_crtc} and +@command{Screen.find_by_crtc}, are not used, those are +not useful for anything. They can be used for seaching +the number of connected monitors, but +@command{Screen.crtc_count} is much more effective. + +@item current-settings +This is a small example demonstrates how the currents +settings can be read and transitioned from. + +@item darkroom +This is a samll example inverts the colours and then +makes the monitors red and dim. It is exited by running +again with Blueshift's @option{-r} (@option{--reset}) +option. + +@item icc-profile-atoms +This is a tiny example that demonstrates how to read +and use the @var{_ICC_PROFILE(_n)} atoms for X screens. + +@c @item lisp-esque +@c @itemx lisp-esque.conf + +@item logarithmic +A very small example that uses free function modifier +and temporary curve linearisation to make the colour +curves logarithmic. + +@item modes +This example can be used to name a mode you want to use, +without having to use Blueshift's @option{-c} option and +give a pathname. You will only need to give a filename. +In this example, those modes are installed in the directory +@file{$@var{XDG_CONFIG_HOME}/blueshift-modes}, and the +default mode is named @file{default}. + +@item sleepmode +This example graciously fades out the screen on start and +in on exit. It is a nice alternative to turning off the +monitor, just press @kbd{Control+c} when you wake up. + +@item stored-settings +This example demonstrates how settings can be stored +and be transition from later. + +@item textconf +@itemx textconf.conf +This example uses a text based configuration file to make +it easier for non-programmers to use Blueshift. It will +read a file with the same pathname just with @file{.conf} +appended (@file{textconf.conf} in this case.) However, if +the filename of this file ends with with @file{rc}, that +part will be removed, for example, if you rename this +script to @file{~/.blueshiftrc} it will read +@file{~/.blueshift.conf} rather than +@file{~/.blueshiftrc.conf}. + +@item threaded +This is an example demonstrates how you can make a +multithreaded configurations script. + +@item weather +This is a samll example demonstrates how to include +weather conditions in your configuration scripts. + +@item xmobar +This example can be used in @command{xmobar} to display +the Sun's elevation and to what degree it is day time. + +@item xmonad +This configuration scripts read the @command{xmonad} +log to detect which workspace you are viewing. It can +also disable adjustments when you are in selected +programs such as The GIMP and Inkscape. + +@item xpybar +This example can be used in @command{xpybar} to display +the Sun's elevation and to what degree it is day time. + +@end table + + + @node Related software @chapter Related software -- cgit v1.2.3-70-g09d2