Update doc
o9000 mrovi9000@gmail.com
5 files changed,
78 insertions(+),
13 deletions(-)
M
doc/manual.html
→
doc/manual.html
@@ -199,7 +199,7 @@
</style> </head> <body> -<h1 id="tint2"><span class="md2man-title">TINT2</span><a name="tint2" href="#tint2" class="md2man-permalink" title="permalink"></a></h1><h2 id="name">NAME<a name="name" href="#name" class="md2man-permalink" title="permalink"></a></h2><p>tint2 - lightweight panel/taskbar</p><h2 id="synopsis">SYNOPSIS<a name="synopsis" href="#synopsis" class="md2man-permalink" title="permalink"></a></h2><p><code>tint2 [-c path_to_config_file]</code></p><h2 id="description">DESCRIPTION<a name="description" href="#description" class="md2man-permalink" title="permalink"></a></h2><p>tint2 is a simple panel/taskbar made for modern X window managers. +<h1 id="tint2"><span class="md2man-title">TINT2</span><a name="tint2" href="#tint2" class="md2man-permalink" title="permalink"></a></h1><h2 id="name">NAME<a name="name" href="#name" class="md2man-permalink" title="permalink"></a></h2><p>tint2 - lightweight panel/taskbar</p><h2 id="description">DESCRIPTION<a name="description" href="#description" class="md2man-permalink" title="permalink"></a></h2><p>tint2 is a simple panel/taskbar made for modern X window managers. It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).</p><p>Features:</p> <ul> <li>Panel with taskbar, system tray, clock and launcher icons;</li>@@ -214,7 +214,7 @@ <li>Be unintrusive and light (in terms of memory, CPU and aesthetic);</li>
<li>Follow the freedesktop.org specifications;</li> <li>Make certain workflows, such as multi-desktop and multi-monitor, easy to use.</li> </ul> -<h2 id="options">OPTIONS<a name="options" href="#options" class="md2man-permalink" title="permalink"></a></h2><dl><dt><code>-c path_to_config_file</code></dt><dd>Specifies which configuration file to use instead of the default.</dd></dl><h2 id="configuration">CONFIGURATION<a name="configuration" href="#configuration" class="md2man-permalink" title="permalink"></a></h2><h3 id="table-of-contents">Table of contents<a name="table-of-contents" href="#table-of-contents" class="md2man-permalink" title="permalink"></a></h3> +<h2 id="synopsis">SYNOPSIS<a name="synopsis" href="#synopsis" class="md2man-permalink" title="permalink"></a></h2><p><code>tint2 [OPTION...]</code></p><h2 id="options">OPTIONS<a name="options" href="#options" class="md2man-permalink" title="permalink"></a></h2><dl><dt><code>-c path_to_config_file</code></dt><dd>Specifies which configuration file to use instead of the default.</dd></dl><dl><dt><code>-v, --version</code></dt><dd>Prints version information and exits.</dd></dl><dl><dt><code>-h, --help</code></dt><dd>Display this help and exits.</dd></dl><h2 id="configuration">CONFIGURATION<a name="configuration" href="#configuration" class="md2man-permalink" title="permalink"></a></h2><h3 id="table-of-contents">Table of contents<a name="table-of-contents" href="#table-of-contents" class="md2man-permalink" title="permalink"></a></h3> <ul> <li><p><a href="#introduction">Introduction</a></p></li> <li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li>
M
doc/tint2.1
→
doc/tint2.1
@@ -2,9 +2,6 @@ .TH TINT2 1 "2017\-03\-26" 0.14.1
.SH NAME .PP tint2 \- lightweight panel/taskbar -.SH SYNOPSIS -.PP -\fB\fCtint2 [\-c path_to_config_file]\fR .SH DESCRIPTION .PP tint2 is a simple panel/taskbar made for modern X window managers.@@ -33,10 +30,19 @@ Follow the freedesktop.org specifications;
.IP \(bu 2 Make certain workflows, such as multi\-desktop and multi\-monitor, easy to use. .RE +.SH SYNOPSIS +.PP +\fB\fCtint2 [OPTION...]\fR .SH OPTIONS .TP \fB\fC\-c path_to_config_file\fR Specifies which configuration file to use instead of the default. +.TP +\fB\fC\-v, \-\-version\fR +Prints version information and exits. +.TP +\fB\fC\-h, \-\-help\fR +Display this help and exits. .SH CONFIGURATION .SS Table of contents .RS
M
doc/tint2.md
→
doc/tint2.md
@@ -3,9 +3,6 @@
## NAME tint2 - lightweight panel/taskbar -## SYNOPSIS -`tint2 [-c path_to_config_file]` - ## DESCRIPTION tint2 is a simple panel/taskbar made for modern X window managers. It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).@@ -24,9 +21,19 @@ * Be unintrusive and light (in terms of memory, CPU and aesthetic);
* Follow the freedesktop.org specifications; * Make certain workflows, such as multi-desktop and multi-monitor, easy to use. +## SYNOPSIS +`tint2 [OPTION...]` + ## OPTIONS `-c path_to_config_file` Specifies which configuration file to use instead of the default. + +`-v, --version` + Prints version information and exits. + +`-h, --help` + Display this help and exits. + ## CONFIGURATION
M
get_version.sh
→
get_version.sh
@@ -3,7 +3,45 @@
MAJOR=0.14 DIRTY="" -VERSION=0.14 +if git status 1>/dev/null 2>/dev/null +then + git update-index -q --ignore-submodules --refresh + # Disallow unstaged changes in the working tree + if ! git diff-files --quiet --ignore-submodules -- + then + if [ "$1" = "--strict" ] + then + echo >&2 "Error: there are unstaged changes." + git diff-files --name-status -r --ignore-submodules -- >&2 + exit 1 + else + DIRTY="-dirty" + fi + fi + + # Disallow uncommitted changes in the index + if ! git diff-index --cached --quiet HEAD --ignore-submodules -- + then + if [ "$1" = "--strict" ] + then + echo >&2 "Error: there are uncommitted changes." + git diff-index --cached --name-status -r --ignore-submodules HEAD -- >&2 + exit 1 + else + DIRTY="-dirty" + fi + fi + VERSION=$(git describe --exact-match 2>/dev/null || echo "$MAJOR-git$(git show -s --pretty=format:%ci | cut -d ' ' -f 1 | tr -d '-').$(git show -s --pretty=format:%h)")$DIRTY +else + VERSION=$(head -n 1 ChangeLog | cut -d ' ' -f 2) + if [ $VERSION = "master" ] + then + VERSION=$VERSION-$(head -n 1 ChangeLog | cut -d ' ' -f 1) + fi +fi + + +VERSION=$(echo "$VERSION" | sed 's/^v//') echo '#define VERSION_STRING "'$VERSION'"' > version.h echo $VERSION
M
src/tint.c
→
src/tint.c
@@ -374,6 +374,20 @@ {
handle_crash("X11 I/O error"); } +void print_usage() +{ + printf("Usage: tint2 [OPTION...]\n" + "\n" + "Options:\n" + " -c path_to_config_file Loads the configuration file from a\n" + " custom location.\n" + " -v, --version Prints version information and exits.\n" + " -h, --help Display this help and exits.\n" + "\n" + "For more information, run `man tint2` or visit the project page\n" + "<https://gitlab.com/o9000/tint2>.\n"); +} + void init(int argc, char *argv[]) { // Make stdout/stderr flush after a newline (for some reason they don't even if tint2 is started from a terminal)@@ -400,7 +414,7 @@ // Read command line arguments
for (int i = 1; i < argc; ++i) { int error = 0; if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { - printf("Usage: tint2 [[-c] <config_file>]\n"); + print_usage(); exit(0); } else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { printf("tint2 version %s\n", VERSION_STRING);@@ -438,7 +452,7 @@ else {
error = 1; } if (error) { - printf("Usage: tint2 [[-c] <config_file>]\n"); + print_usage(); exit(1); } }@@ -1641,8 +1655,8 @@ init_X11_pre_config();
if (!config_read()) { fprintf(stderr, - "Could not read config file.\n" - "Usage: tint2 [[-c] <config_file>]\n"); + "Could not read config file.\n"); + print_usage(); cleanup(); exit(1); }