summaryrefslogtreecommitdiffstats
path: root/input/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-05-14 21:49:07 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-05-14 21:49:07 +0000
commit2ce4523624b67b48da037beceffe5710144850ec (patch)
treed9b89144c590890b60ca2892244560305cd82775 /input/main.c
parent021c7fa891b23d8623beebf3f9ee79a36a1ff174 (diff)
Add support for IdleTimeout config option
Diffstat (limited to 'input/main.c')
-rw-r--r--input/main.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/input/main.c b/input/main.c
index b57286b2..6018cf7e 100644
--- a/input/main.c
+++ b/input/main.c
@@ -34,6 +34,7 @@
#include "plugin.h"
#include "dbus-service.h"
+#include "logging.h"
#include "manager.h"
#define HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
@@ -45,17 +46,40 @@ static const char *uuids[] = {
static DBusConnection *conn;
+static GKeyFile *load_config_file(const char *file)
+{
+ GKeyFile *keyfile;
+ GError *err = NULL;
+
+ keyfile = g_key_file_new();
+
+ if (!g_key_file_load_from_file(keyfile, file, 0, &err)) {
+ error("Parsing %s failed: %s", file, err->message);
+ g_error_free(err);
+ g_key_file_free(keyfile);
+ return NULL;
+ }
+
+ return keyfile;
+}
+
static int input_init(void)
{
+ GKeyFile *config;
+
conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
if (conn == NULL)
return -EIO;
- if (input_manager_init(conn) < 0) {
+ config = load_config_file(CONFIGDIR "/input.conf");
+
+ if (input_manager_init(conn, config) < 0) {
dbus_connection_unref(conn);
return -EIO;
}
+ g_key_file_free(config);
+
register_service("input", uuids);
return 0;