From fdcda651241ace04d895b9efa77d261029e0da68 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sat, 22 Oct 2022 21:55:58 +0100 Subject: Add --terminal option. --- src/main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 3e84f49..900066b 100644 --- a/src/main.c +++ b/src/main.c @@ -678,6 +678,8 @@ static void usage() " --drun-print-exec Print a command line in drun mode.\n" " This is now always the case,\n" " and this option is deprecated.\n" +" --terminal Terminal to use for command line\n" +" programs in drun mode.\n" " --hint-font Perform font hinting.\n" " --late-keyboard-init (EXPERIMENTAL) Delay keyboard\n" " initialisation until after the first\n" @@ -729,6 +731,7 @@ const struct option long_options[] = { {"hidden-character", required_argument, NULL, 0}, {"drun-launch", required_argument, NULL, 0}, {"drun-print-exec", required_argument, NULL, 0}, + {"terminal", required_argument, NULL, 0}, {"hint-font", required_argument, NULL, 0}, {"output", required_argument, NULL, 0}, {"scale", required_argument, NULL, 0}, @@ -835,7 +838,7 @@ static bool do_submit(struct tofi *tofi) if (tofi->drun_launch) { drun_launch(res); } else { - drun_print(res); + drun_print(res, tofi->default_terminal); } } else { printf("%s\n", res); @@ -894,6 +897,13 @@ int main(int argc, char *argv[]) .use_scale = true, }; wl_list_init(&tofi.output_list); + if (getenv("TERMINAL") != NULL) { + snprintf( + tofi.default_terminal, + N_ELEM(tofi.default_terminal), + "%s", + getenv("TERMINAL")); + } parse_args(&tofi, argc, argv); -- cgit v1.2.3