From: Michael Stapelberg Date: Mon, 11 Jul 2011 17:41:49 +0000 (+0200) Subject: config-wizard: read config from SYSCONFDIR/i3/config.keycodes X-Git-Tag: tree-pr4~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=81340523be7cd33cf0f05aadb66304d28f990430;p=i3%2Fi3 config-wizard: read config from SYSCONFDIR/i3/config.keycodes --- diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index a4dd070c..c8d148cb 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -35,6 +35,12 @@ #include #include +/* We need SYSCONFDIR for the path to the keycode config template, so raise an + * error if it’s not defined for whatever reason */ +#ifndef SYSCONFDIR +#error "SYSCONFDIR not defined" +#endif + #define FREE(pointer) do { \ if (pointer != NULL) { \ free(pointer); \ @@ -217,9 +223,9 @@ static void finish() { if (!(dpy = XOpenDisplay(NULL))) errx(1, "Could not connect to X11"); - FILE *kc_config = fopen("../i3.config.kc", "r"); + FILE *kc_config = fopen(SYSCONFDIR "/i3/config.keycodes", "r"); if (kc_config == NULL) - err(1, "Could not open input file \"%s\"", "../i3.config.kc"); + err(1, "Could not open input file \"%s\"", SYSCONFDIR "/i3/config.keycodes"); FILE *ks_config = fopen(config_path, "w"); if (ks_config == NULL)