diff --git a/clients/lcdproc/lcdproc.conf b/clients/lcdproc/lcdproc.conf index 850464c..7fd59c5 100644 --- a/clients/lcdproc/lcdproc.conf +++ b/clients/lcdproc/lcdproc.conf @@ -14,8 +14,8 @@ ReportLevel=2 # report to to syslog ? ReportToSyslog=false -# stay in foreground ? -Foreground=false +# Run in background (Default: true) +#Daemonize=true # slow down initial announcement of modes (in 1/100s) #delay=2 @@ -25,61 +25,61 @@ Foreground=false [CPU] # Show screen -Active = True -OnTime = 1 -OffTime = 2 -ShowInvisible = false +Active=True +OnTime=1 +OffTime=2 +ShowInvisible=false [Memory] # Show screen -Active = True +Active=True [Load] # Show screen -Active = True +Active=True [TimeDate] # Show screen -Active = True +Active=True [About] # Show screen -Active = false +Active=false [SMP-CPU] # Show screen -Active = false +Active=false [OldTime] # Show screen -Active = false +Active=false [BigClock] # Show screen -Active = false +Active=false [Uptime] # Show screen -Active = false +Active=false [Battery] # Show screen -Active = false +Active=false [CPUGraph] # Show screen -Active = false +Active=false [ProcSize] # Show screen -Active = false +Active=false [Disk] # Show screen -Active = false +Active=false [MiniClock] # Show screen -Active = True +Active=True # EOF diff --git a/clients/lcdproc/main.c b/clients/lcdproc/main.c index 4fa2393..5bf462d 100644 --- a/clients/lcdproc/main.c +++ b/clients/lcdproc/main.c @@ -73,7 +73,8 @@ static int process_configfile(char *cfgfile); #define UNSET_STR "\01" #define DEFAULT_SERVER "127.0.0.1" #define DEFAULT_CONFIGFILE SYSCONFDIR "/lcdproc.conf" - +#define DEFAULT_REPORTDEST RPT_DEST_STDERR +#define DEFAULT_REPORTLEVEL RPT_WARNING /* list of modes to run */ mode sequence[] = @@ -104,7 +105,7 @@ static int islow = -1; char * progname = "lcdproc"; char * server = NULL; int port = LCDPORT; -int daemonize = FALSE; +int daemonize = UNSET_INT; static int report_level = UNSET_INT; static int report_dest = UNSET_INT; char configfile[256]; /* a lot of space in the executable. */ @@ -159,7 +160,6 @@ void clear_modes() int main(int argc, char **argv) { - int daemonize = FALSE; int error = 0; /* get uname information */ @@ -184,6 +184,15 @@ main(int argc, char **argv) if (strcmp(configfile, UNSET_STR) != 0) CHAIN( error, process_configfile(configfile) ); + /* Set default options */ + if (report_dest == UNSET_INT ) + report_dest = DEFAULT_REPORTDEST; + if( report_level == UNSET_INT ) + report_level = DEFAULT_REPORTLEVEL; + + /* Set reporting settings */ + set_reporting("lcdproc", report_level, report_dest); + CHAIN_END( error, "Error in config file or command line\n" ); if (server == NULL) @@ -333,7 +342,7 @@ process_configfile(char *configfile) } } if (daemonize == UNSET_INT) { - daemonize = config_get_bool(progname, "Foreground", 0, 1); + daemonize = config_get_bool(progname, "Daemonize", 0, 1); } if (islow < 0) { islow = config_get_int(progname, "delay", 0, -1);