let lcdproc & lcdexec have their own private config file;

install server & client config files to $(sysconfdir) (using automake features)
This commit is contained in:
marschap
2006-04-15 19:48:11 +00:00
parent 16b89aa65e
commit ff0cb79b17
13 changed files with 107 additions and 19 deletions
+1 -1
View File
@@ -2,6 +2,6 @@
bin_SCRIPTS = fortune.pl iosock.pl tail.pl x11amp.pl
EXTRA_DIST = fortune.pl iosock.pl tail.pl x11amp.pl
EXTRA_DIST = $(bin_SCRIPTS)
## EOF
+1 -1
View File
@@ -2,6 +2,6 @@
bin_SCRIPTS = lcdheadlines
EXTRA_DIST = lcdheadlines
EXTRA_DIST = $(bin_SCRIPTS)
## EOF
+6 -1
View File
@@ -1,11 +1,16 @@
## Process this file with automake to produce Makefile.in
sysconf_DATA = lcdexec.conf
bin_PROGRAMS = lcdexec
lcdexec_SOURCES = lcdexec.c menu.c menu.h
lcdexec_LDADD = @ldap_libs@ ../../shared/libLCDstuff.a
AM_CPPFLAGS = -I$(top_srcdir)
AM_CPPFLAGS = -I$(top_srcdir) -DSYSCONFDIR=\"$(sysconfdir)\"
EXTRA_DIST = $(sysconf_DATA)
## EOF
+6 -1
View File
@@ -33,7 +33,12 @@
#include "menu.h"
#define DEFAULT_CONFIGFILE "/etc/LCDclients.conf"
#if !defined(SYSCONFDIR)
# define SYSCONFDIR "/etc"
#endif
#define DEFAULT_CONFIGFILE SYSCONFDIR "/lcdexec.conf"
char * help_text =
"lcdexec - LCDproc client to execute commands from the LCDd menu.\n"
+57
View File
@@ -0,0 +1,57 @@
# lcdexec LCDproc client configuration file
## general options for lcdexec ##
[lcdexec]
# address of the LCDd server to connect to
Address=localhost
# Port of the server to connect to
Port=13666
# set reporting level
ReportLevel=2
# report to to syslog ?
ReportToSyslog=false
# stay in foreground ?
Foreground=false
# menu commands for the main menu
# format: <text to be displayed>, <command to be executed>
MenuCommand="You can say A, echo A"
MenuCommand="Or you can say B, echo B"
# sub menu for the main menu
# format: <name to be displayed>, <menu name>
SubMenu="A menu, menu1"
# sub menu commands
# option names must start with the name of a defined menu
# format: see menu commands
menu1_MenuCommand="p, echo P"
menu1_MenuCommand="q, echo Q"
# Ideally lcdexec should be re-written so that menu definitions
# look somewhat like:
#
#[Menu]
#Type=Menu
#Entry=SubMenu1
#Entry=SubMenu2
#
#[SubMenu1]
#Type=Action
#Exec=/bin/program to execute with parameters
#
#[SubMenu2]
#Type=Action
#Exec=/bin/otherprogram with parameters
#
# Further Extensions:
# - use input for parameters e.g. IP-Adresses, Sliders
# - display result if a command on Screen
# - jump to other menus depending on the output/result of a command
# EOF
+6 -1
View File
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in
sysconf_DATA = lcdproc.conf
bin_PROGRAMS = lcdproc
lcdproc_SOURCES = main.c main.h mode.c mode.h batt.c batt.h chrono.c chrono.h cpu.c cpu.h cpu_smp.c cpu_smp.h disk.c disk.h load.c load.h mem.c mem.h machine.h machine_Linux.c machine_OpenBSD.c machine_FreeBSD.c machine_NetBSD.c machine_Darwin.c machine_SunOS.c util.c util.h
@@ -10,6 +12,9 @@ if DARWIN
AM_LDFLAGS = -framework CoreFoundation -framework IOKit
endif
AM_CPPFLAGS = -I$(top_srcdir)
AM_CPPFLAGS = -I$(top_srcdir) -DSYSCONFDIR=\"$(sysconfdir)\"
EXTRA_DIST = $(sysconf_DATA)
## EOF
+13 -7
View File
@@ -57,14 +57,24 @@ static void exit_program(int val);
static void main_loop();
static int process_command_line(int argc, char **argv);
static int process_configfile(char *cfgfile);
#define CHAIN(e,f) { if (e>=0 ) { e=(f); }}
#define CHAIN_END(e,msg) { if (e<0 ) { report( RPT_CRIT,(msg)); exit(e); }}
static int islow = -1;
// 1/8th second is a single time unit...
#define TIME_UNIT 125000
#if !defined(SYSCONFDIR)
# define SYSCONFDIR "/etc"
#endif
#define UNSET_INT -1
#define UNSET_STR "\01"
#define DEFAULT_SERVER "127.0.0.1"
#define DEFAULT_CONFIGFILE SYSCONFDIR "/lcdproc.conf"
/* list of modes to run */
mode sequence[] =
{
@@ -89,12 +99,8 @@ mode sequence[] =
// TODO: Config file; not just command line
/* All variables are set to 'unset' values*/
#define UNSET_INT -1
#define UNSET_STR "\01"
#define DEFAULT_SERVER "127.0.0.1"
#define DEFAULT_CONFIGFILE "/usr/local/etc/lcdproc.conf"
static int islow = -1;
char * progname = "lcdproc";
char * server = NULL;
int port = LCDPORT;
+1 -1
View File
@@ -2,6 +2,6 @@
bin_SCRIPTS = lcdmetar.pl
EXTRA_DIST = lcdmetar.pl
EXTRA_DIST = $(bin_SCRIPTS)
## EOF