aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-04-01 17:59:47 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-04-01 17:59:47 +0000
commitec7a7684876c06764a583a1cefe2a93f6706e3ca (patch)
treea56aacfe68b35eadbf4025a5c366b36585fe7d82 /main.c
parentcompletions: zsh: repair -a,--app-id completions (diff)
conf: add 'title' conf option and --title command line option
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.c b/main.c
index add743d1..39e90bbf 100644
--- a/main.c
+++ b/main.c
@@ -46,6 +46,7 @@ print_usage(const char *prog_name)
" -c,--config=PATH load configuration from PATH (XDG_CONFIG_HOME/footrc)\n"
" -f,--font=FONT comma separated list of fonts in fontconfig format (monospace)\n"
" -t,--term=TERM value to set the environment variable TERM to (foot)\n"
+ " --title=TITLE initial window title (foot)\n"
" -a,--app-id=ID window application ID (foot)\n"
" --maximized start in maximized mode\n"
" --fullscreen start in fullscreen mode\n"
@@ -140,6 +141,7 @@ main(int argc, char *const *argv)
static const struct option longopts[] = {
{"config", required_argument, NULL, 'c'},
{"term", required_argument, NULL, 't'},
+ {"title", required_argument, NULL, 'T'},
{"app-id", required_argument, NULL, 'a'},
{"login-shell", no_argument, NULL, 'L'},
{"font", required_argument, NULL, 'f'},
@@ -159,6 +161,7 @@ main(int argc, char *const *argv)
const char *conf_path = NULL;
const char *conf_term = NULL;
+ const char *conf_title = NULL;
const char *conf_app_id = NULL;
bool login_shell = false;
tll(char *) conf_fonts = tll_init();
@@ -193,6 +196,10 @@ main(int argc, char *const *argv)
login_shell = true;
break;
+ case 'T':
+ conf_title = optarg;
+ break;
+
case 'a':
conf_app_id = optarg;
break;
@@ -313,6 +320,10 @@ main(int argc, char *const *argv)
free(conf.term);
conf.term = strdup(conf_term);
}
+ if (conf_title != NULL) {
+ free(conf.title);
+ conf.title = strdup(conf_title);
+ }
if (conf_app_id != NULL) {
free(conf.app_id);
conf.app_id = strdup(conf_app_id);