From 828b7fb505feb7c61d28a473eb0eb9aea0fb4db8 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Sat, 28 Jun 2014 18:04:10 +0200 Subject: [PATCH] Add help target and toxic.conf manpage --- README.md | 2 +- build/Makefile | 16 ++-- cfg/help.mk | 16 ++++ doc/toxic.1 | 19 +++- doc/toxic.conf.5 | 119 ++++++++++++++++++++++++ misc/{toxic.conf => toxic.conf.example} | 0 6 files changed, 164 insertions(+), 8 deletions(-) create mode 100644 cfg/help.mk create mode 100644 doc/toxic.conf.5 rename misc/{toxic.conf => toxic.conf.example} (100%) diff --git a/README.md b/README.md index 7b21218..86b66dd 100644 --- a/README.md +++ b/README.md @@ -43,5 +43,5 @@ sudo ldconfig ## Settings Running Toxic for the first time creates an empty file called toxic.conf in your home configuration directory ("~/.config/tox" for Linux users). Adding options to this file allows you to enable auto-logging, change the time format (12/24 hour), and much more. -You can view our example config file [here](misc/toxic.conf). +You can view our example config file [here](misc/toxic.conf.example). diff --git a/build/Makefile b/build/Makefile index 8e28ab1..de03d6d 100644 --- a/build/Makefile +++ b/build/Makefile @@ -9,9 +9,9 @@ DOC_DIR = ../doc PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic -MANDIR = $(PREFIX)/man/man1 -DATAFILES = DHTnodes -MANFILES = toxic.1 +MANDIR = $(PREFIX)/man +DATAFILES = DHTnodes toxic.conf.example +MANFILES = toxic.1 toxic.conf.5 LIBS = libtoxcore ncursesw @@ -102,9 +102,11 @@ install: toxic done @echo "Installing man pages" @for f in $(MANFILES) ; do \ - file=$(abspath $(DESTDIR)/$(MANDIR))/$$f ;\ - install -m 0644 $(DOC_DIR)/$$f $(abspath $(DESTDIR)/$(MANDIR)) ;\ - sed -i'' -e 's:__VERSION__:'$(VERSION)':' $$file ;\ + section=$(abspath $(DESTDIR)/$(MANDIR))/man`echo $$f | rev | cut -d "." -f 1` ;\ + file=$$section/$$f ;\ + mkdir -p $$section ;\ + install -m 0644 $(DOC_DIR)/$$f $$file ;\ + sed -i'' -e 's:__VERSION__:'$(VERSION)':g' $$file ;\ sed -i'' -e 's:__DATADIR__:'$(abspath $(DATADIR))':g' $$file ;\ gzip -f -9 $$file ;\ done @@ -116,6 +118,8 @@ install: toxic clean: rm -rf *.d *.o toxic +-include $(CFG_DIR)/help.mk + -include $(OBJ:.o=.d) .PHONY: clean all install diff --git a/cfg/help.mk b/cfg/help.mk new file mode 100644 index 0000000..830eb3b --- /dev/null +++ b/cfg/help.mk @@ -0,0 +1,16 @@ +# Help target +help: + @echo "-- Targets --" + @echo " all: Build toxic [DEFAULT]" + @echo " toxic: Build toxic" + @echo " install: Build toxic and install it in PREFIX (default PREFIX is \"$(abspath $(PREFIX))\")" + @echo " clean: Remove built files" + @echo " help: This help" + @echo + @echo "-- Variables --" + @echo " USER_CFLAGS: Add custom flags to default CFLAGS" + @echo " USER_LDFLAGS: Add custom flags to default LDFLAGS" + @echo " PREFIX: Specify a prefix directory for binaries, data files,... (default is \"$(abspath $(PREFIX))\")" + @echo " DESTDIR: Specify a directory where to store installed files (mainly for packaging purpose)" + +.PHONY: help diff --git a/doc/toxic.1 b/doc/toxic.1 index 5598e38..8c988c5 100644 --- a/doc/toxic.1 +++ b/doc/toxic.1 @@ -35,11 +35,28 @@ for DHT bootstrap nodes, instead of .IR __DATADIR__/DHTnodes .IP "\-h, \-\-help" Show help message +.SH FILES +.IP __DATADIR__/DHTnodes +Default list of DHT bootstrap nodes. +.IP ~/.config/tox/data +Savestate which contains your personal info (nickname, Tox ID,...) and +your contacts list. +.IP ~/.config/tox/toxic.conf +Configuration file. See +.BR toxic.conf (5) +for more details. +.IP __DATADIR__/toxic.conf.example +Configuration example. .SH BUGS -Resizing the terminal breaks the layout. We suggest you size your terminal as desired prior to starting the client. Unicode characters with a width larger than 1 column may cause strange behaviour. Expect more bugs and bad behaviour: this software is in a pre\-alpha stage. +Resizing the terminal breaks the layout. We suggest you size your terminal as +desired prior to starting the client. Unicode characters with a width larger +than 1 column may cause strange behaviour. Expect more bugs and bad +behaviour: this software is in a pre\-alpha stage. .SH AUTHORS JFreegman .SH SEE ALSO +.BR toxic.conf (5) +.SH LINKS Project page on github: https://github.com/Tox/toxic .br IRC channel on Freenode: chat.freenode.net#tox diff --git a/doc/toxic.conf.5 b/doc/toxic.conf.5 new file mode 100644 index 0000000..11036f3 --- /dev/null +++ b/doc/toxic.conf.5 @@ -0,0 +1,119 @@ +.TH TOXIC.CONF 5 "June 2014" "Toxic v__VERSION__" "User Manual" +.SH NAME +toxic.conf \- Configuration file for toxic(1) +.SH DESCRIPTION +The +.I toxic.conf +file is the main configuration file for +.BR toxic (1) +client. +.SH SYNTAX +.IB : ; +.PP +Lines starting with "#" are comments and will be ignored. +.PP +Keys: +.RS +.B time +.RS +Select between 24 and 12 hour time. +.br +Values: 24, 12 +.RE +.PP +.B autolog +.RS +Enable or disable autologging. +.br +Values: 1 to enable, 0 to disable +.RE +.PP +.B disable_alerts +.RS +Enable or disable terminal alerts on messages. +.br +Values: 0 to enable, 1 to disable +.RE +.PP +.B history_size +.RS +Maximum lines for chat window history. +.br +Values: (for example: 700) +.RE +.PP +.B colour_theme +.RS +Select between toxic colour theme and notive terminal colours. +.br +Values: 0 for toxic colours, 1 for terminal colours +.RE +.PP +.B audio_in_dev +.RS +Audio input device. +.br +Values: (number correspond to "/lsdev in") +.RE +.PP +.B audio_out_dev +.RS +Audio output device. +.br +Values: (number correspond to "/lsdev out") +.RE +.PP +.B download_path +.RS +Default path for downloads. +.br +Values: (absolute path where to store downloaded files) +.RE +.RE +.SH EXAMPLES +This is from __DATADIR__/toxic.conf.exmaple: +.PP +# 24 or 12 hour time +.br +time:24; +.br +# 1 to enable autologging, 0 to disable +.br +autolog:0; +.br +# 1 to disbale terminal alerts on messages, 0 to enable +.br +disable_alerts:0; +.br +# maximum lines for chat window history +.br +history_size:700; +.br +# 1 to use native terminal colours, 0 to use toxic default colour theme +.br +colour_theme:0; +.br +# preferred audio input device; numbers correspond to /lsdev in +.br +audio_in_dev:0; +.br +# preferred audio output device; numbers correspond to /lsdev out +.br +audio_out_dev:0; +.br +# preferred path for downloads +.br +download_path:/home/USERNAME/Downloads/; +.SH FILES +.IP ~/.config/tox/toxic.conf +Main configuration file. +.IP __DATADIR__/toxic.conf.example +Configuration example. +.SH AUTHORS +JFreegman +.SH SEE ALSO +.BR toxic (1) +.SH LINKS +Project page on github: https://github.com/Tox/toxic +.br +IRC channel on Freenode: chat.freenode.net#tox diff --git a/misc/toxic.conf b/misc/toxic.conf.example similarity index 100% rename from misc/toxic.conf rename to misc/toxic.conf.example