From 079f68696bc425e178f56e9e1ad62dc1a681e7d5 Mon Sep 17 00:00:00 2001 From: Utkarsh Verma Date: Fri, 3 Jun 2022 07:43:19 +0530 Subject: [PATCH] Make xinitrc path configurable --- res/config.ini | 3 +++ src/config.c | 3 +++ src/config.h | 1 + src/inputs.c | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/res/config.ini b/res/config.ini index f9d9db49..690d927b 100644 --- a/res/config.ini +++ b/res/config.ini @@ -94,6 +94,9 @@ # xorg server command #x_cmd = /usr/bin/X +# xinitrc +#xinitrc = ~/.xinitrc + # xorg setup command #x_cmd_setup = /etc/ly/xsetup.sh diff --git a/src/config.c b/src/config.c index 4b53055e..334a234e 100644 --- a/src/config.c +++ b/src/config.c @@ -189,6 +189,7 @@ void config_load(const char *cfg_path) {"wayland_specifier", &config.wayland_specifier, config_handle_bool}, {"waylandsessions", &config.waylandsessions, config_handle_str}, {"x_cmd", &config.x_cmd, config_handle_str}, + {"xinitrc", &config.xinitrc, config_handle_str}, {"x_cmd_setup", &config.x_cmd_setup, config_handle_str}, {"xauth_cmd", &config.xauth_cmd, config_handle_str}, {"xsessions", &config.xsessions, config_handle_str}, @@ -295,6 +296,7 @@ void config_defaults() config.wayland_specifier = false; config.waylandsessions = strdup("/usr/share/wayland-sessions"); config.x_cmd = strdup("/usr/bin/X"); + config.xinitrc = strdup("~/.xinitrc"); config.x_cmd_setup = strdup(DATADIR "/xsetup.sh"); config.xauth_cmd = strdup("/usr/bin/xauth"); config.xsessions = strdup("/usr/share/xsessions"); @@ -363,6 +365,7 @@ void config_free() free(config.wayland_cmd); free(config.waylandsessions); free(config.x_cmd); + free(config.xinitrc); free(config.x_cmd_setup); free(config.xauth_cmd); free(config.xsessions); diff --git a/src/config.h b/src/config.h index 87ae833b..b63e3c43 100644 --- a/src/config.h +++ b/src/config.h @@ -93,6 +93,7 @@ struct config bool wayland_specifier; char* waylandsessions; char* x_cmd; + char* xinitrc; char* x_cmd_setup; char* xauth_cmd; char* xsessions; diff --git a/src/inputs.c b/src/inputs.c index d425c063..69a7e9ba 100644 --- a/src/inputs.c +++ b/src/inputs.c @@ -82,7 +82,7 @@ void input_desktop(struct desktop* target) target->len = 0; input_desktop_add(target, strdup(lang.shell), strdup(""), DS_SHELL); - input_desktop_add(target, strdup(lang.xinitrc), strdup("~/.xinitrc"), DS_XINITRC); + input_desktop_add(target, strdup(lang.xinitrc), strdup(config.xinitrc), DS_XINITRC); #if 0 input_desktop_add(target, strdup(lang.wayland), strdup(""), DS_WAYLAND); #endif