Update doc

This commit is contained in:
o9000 2017-03-26 22:04:35 +02:00
parent 6cde7bef1e
commit 1c1ba904a4
5 changed files with 78 additions and 13 deletions

View file

@ -199,7 +199,7 @@ pre {
</style> </style>
</head> </head>
<body> <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> It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).</p><p>Features:</p>
<ul> <ul>
<li>Panel with taskbar, system tray, clock and launcher icons;</li> <li>Panel with taskbar, system tray, clock and launcher icons;</li>
@ -214,7 +214,7 @@ It was specifically made for Openbox but it should also work with other window m
<li>Follow the freedesktop.org specifications;</li> <li>Follow the freedesktop.org specifications;</li>
<li>Make certain workflows, such as multi-desktop and multi-monitor, easy to use.</li> <li>Make certain workflows, such as multi-desktop and multi-monitor, easy to use.</li>
</ul> </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> <ul>
<li><p><a href="#introduction">Introduction</a></p></li> <li><p><a href="#introduction">Introduction</a></p></li>
<li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li> <li><p><a href="#backgrounds-and-borders">Backgrounds and borders</a></p></li>

View file

@ -2,9 +2,6 @@
.SH NAME .SH NAME
.PP .PP
tint2 \- lightweight panel/taskbar tint2 \- lightweight panel/taskbar
.SH SYNOPSIS
.PP
\fB\fCtint2 [\-c path_to_config_file]\fR
.SH DESCRIPTION .SH DESCRIPTION
.PP .PP
tint2 is a simple panel/taskbar made for modern X window managers. tint2 is a simple panel/taskbar made for modern X window managers.
@ -33,10 +30,19 @@ Follow the freedesktop.org specifications;
.IP \(bu 2 .IP \(bu 2
Make certain workflows, such as multi\-desktop and multi\-monitor, easy to use. Make certain workflows, such as multi\-desktop and multi\-monitor, easy to use.
.RE .RE
.SH SYNOPSIS
.PP
\fB\fCtint2 [OPTION...]\fR
.SH OPTIONS .SH OPTIONS
.TP .TP
\fB\fC\-c path_to_config_file\fR \fB\fC\-c path_to_config_file\fR
Specifies which configuration file to use instead of the default. 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 .SH CONFIGURATION
.SS Table of contents .SS Table of contents
.RS .RS

View file

@ -3,9 +3,6 @@
## NAME ## NAME
tint2 - lightweight panel/taskbar tint2 - lightweight panel/taskbar
## SYNOPSIS
`tint2 [-c path_to_config_file]`
## DESCRIPTION ## DESCRIPTION
tint2 is a simple panel/taskbar made for modern X window managers. 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.). It was specifically made for Openbox but it should also work with other window managers (GNOME, KDE, XFCE etc.).
@ -24,10 +21,20 @@ Goals:
* Follow the freedesktop.org specifications; * Follow the freedesktop.org specifications;
* Make certain workflows, such as multi-desktop and multi-monitor, easy to use. * Make certain workflows, such as multi-desktop and multi-monitor, easy to use.
## SYNOPSIS
`tint2 [OPTION...]`
## OPTIONS ## OPTIONS
`-c path_to_config_file` `-c path_to_config_file`
Specifies which configuration file to use instead of the default. 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 ## CONFIGURATION
### Table of contents ### Table of contents

View file

@ -3,7 +3,45 @@
MAJOR=0.14 MAJOR=0.14
DIRTY="" 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 '#define VERSION_STRING "'$VERSION'"' > version.h
echo $VERSION echo $VERSION

View file

@ -374,6 +374,20 @@ void x11_io_error(Display *display)
handle_crash("X11 I/O error"); 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[]) 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) // 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 @@ void init(int argc, char *argv[])
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {
int error = 0; int error = 0;
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) { if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
printf("Usage: tint2 [[-c] <config_file>]\n"); print_usage();
exit(0); exit(0);
} else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) { } else if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0) {
printf("tint2 version %s\n", VERSION_STRING); printf("tint2 version %s\n", VERSION_STRING);
@ -438,7 +452,7 @@ void init(int argc, char *argv[])
error = 1; error = 1;
} }
if (error) { if (error) {
printf("Usage: tint2 [[-c] <config_file>]\n"); print_usage();
exit(1); exit(1);
} }
} }
@ -1641,8 +1655,8 @@ start:
if (!config_read()) { if (!config_read()) {
fprintf(stderr, fprintf(stderr,
"Could not read config file.\n" "Could not read config file.\n");
"Usage: tint2 [[-c] <config_file>]\n"); print_usage();
cleanup(); cleanup();
exit(1); exit(1);
} }