aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-20 17:35:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-20 17:35:10 +0000
commit6af4b87ec5067380a46adad4ce3c862db155c619 (patch)
tree7af30e2a5b3fd41305c004e98d317c393638f38f
parentclient: add --login-shell command line option (diff)
config: add 'login-shell' option
-rw-r--r--config.c8
-rw-r--r--config.h1
-rw-r--r--main.c2
3 files changed, 11 insertions, 0 deletions
diff --git a/config.c b/config.c
index 1dd6652f..39a72648 100644
--- a/config.c
+++ b/config.c
@@ -159,6 +159,14 @@ parse_section_main(const char *key, const char *value, struct config *conf,
conf->shell = strdup(value);
}
+ else if (strcmp(key, "login-shell") == 0) {
+ conf->login_shell = (
+ strcasecmp(value, "on") == 0 ||
+ strcasecmp(value, "true") == 0 ||
+ strcasecmp(value, "yes") == 0) ||
+ strtoul(value, NULL, 0) > 0;
+ }
+
else if (strcmp(key, "geometry") == 0) {
unsigned width, height;
if (sscanf(value, "%ux%u", &width, &height) != 2 || width == 0 || height == 0) {
diff --git a/config.h b/config.h
index 90376fc0..3677129f 100644
--- a/config.h
+++ b/config.h
@@ -10,6 +10,7 @@
struct config {
char *term;
char *shell;
+ bool login_shell;
unsigned width;
unsigned height;
unsigned pad_x;
diff --git a/main.c b/main.c
index d8370a36..878db875 100644
--- a/main.c
+++ b/main.c
@@ -286,6 +286,8 @@ main(int argc, char *const *argv)
free(conf.term);
conf.term = strdup(conf_term);
}
+ if (login_shell)
+ conf.login_shell = true;
if (tll_length(conf_fonts) > 0) {
tll_free_and_free(conf.fonts, free);
tll_foreach(conf_fonts, it)