Skip to content

Commit 63a2572

Browse files
committed
allow overriding the folder for hdapsd.conf
1 parent 8bb9076 commit 63a2572

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

src/Makefile.am

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"'
2+
13
sbin_PROGRAMS=hdapsd
24
hdapsd_SOURCES=hdapsd.c hdapsd.h input-helper.c input-helper.h
35
hdapsd_CFLAGS=$(LIBCONFIG_CFLAGS)

src/hdapsd.c

+1
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ void usage ()
398398
printf("\n");
399399
#ifdef HAVE_LIBCONFIG
400400
printf(" -c --cfgfile=<cfgfile> Load configuration from <cfgfile>.\n");
401+
printf(" By default, configuration is read from "CONFIG_FILE"\n");
401402
#endif
402403
printf(" -d --device=<device> <device> is likely to be hda or sda.\n");
403404
printf(" Can be given multiple times\n");

src/hdapsd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdio.h>
22

33
#define PID_FILE "/var/run/hdapsd.pid"
4-
#define CONFIG_FILE "/etc/hdapsd.conf"
4+
#define CONFIG_FILE SYSCONFDIR"/hdapsd.conf"
55
#define HDAPS_POSITION_FILE "/sys/devices/platform/hdaps/position"
66
#define MOUSE_ACTIVITY_FILE "/sys/devices/platform/hdaps/keyboard_activity"
77
#define KEYBD_ACTIVITY_FILE "/sys/devices/platform/hdaps/mouse_activity"

0 commit comments

Comments
 (0)