A number of configuration options are useful only during the startup, so it
is possible to free them when ready.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Took opportunity to re-order them alphabetically so they are easier to
work with, both for devs and for users.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
Management of the configuration is split in many places, the goal is to
regroup stuff together, starting with the loading from file stuff.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The PID file was created at the early beginning, but wmix can abort later
if something is not ok. It is better to create it at the end, so it will
be created only if wmix will actually be running.
Took the opportunity to move the code to a dedicated function to keep main
simple, and added a check to fix possible crash on startup if environment
variable $HOME does not exist.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
The original code merely assumed that an XOpenDisplay failure was caused
only by incapacity to connect to the X server, but if $DISPLAY was not set
then the fprintf would be given a NULL pointer which it may not appreciate
(depending on the libc in use).
Let's avoid that case and try to provide more info to help the user.
Signed-off-by: Christophe CURIS <christophe.curis@free.fr>