Skip to content
Myr

Merge branch 'customizable-prompt'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parents 1abbb16, 8028ffe · Browse files · 1 file+23 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+23 added−4 removed

  • other:+23 added−4 removed

1 file+23 added−4 removed

modified:main.c+23 added-4 removed
274 unmodified lines
275 {"selection-text-color", required_argument, 0, 'S'},276 {"border-width", required_argument, 0, 'B'},277 {"border-radius", required_argument, 0, 'r'},278 {"border-color", required_argument, 0, 'C'},279 {"prompt", required_argument, 0, 'P'},280 {"terminal", required_argument, 0, 'T'},281 {"dmenu", no_argument, 0, 'd'},282 {"no-run-if-empty", no_argument, 0, 'R'},283 {"line-height", required_argument, 0, 'H'},
6 unmodified lines
290 const char *output_name = NULL;291 const char *font_name = "monospace";292 const char *icon_theme = "hicolor";293 const char *terminal = NULL;294 const wchar_t *prompt_content = L"> ";295 wchar_t *prompt_allocated = NULL;296 bool dmenu_mode = false;297 bool no_run_if_empty = false;298 bool icons_enabled = true;299
12 unmodified lines
312 .line_height = {-1, 0.0}, /* Use font metrics */313 .letter_spacing = {0},314 };315316 setlocale(LC_CTYPE, "");317318 while (true) {314 int c = getopt_long(argc, argv, ":o:f:i:Il:w:x:y:p:b:t:m:s:S:B:r:C:T:dRvh", longopts, NULL);319 int c = getopt_long(argc, argv, ":o:f:i:Il:w:x:y:p:P:b:t:m:s:S:B:r:C:T:dRvh", longopts, NULL);320 if (c == -1)321 break;322323 switch (c) {
51 unmodified lines
375 return EXIT_FAILURE;376 }377 break;378379 case 'P': {380 size_t wlen = mbstowcs(NULL, optarg, 0);381 if (wlen == (size_t)-1) {382 fprintf(stderr, "%s: invalid prompt\n", optarg);383 return EXIT_FAILURE;384 }385 prompt_allocated = malloc((wlen + 1) * sizeof(wchar_t));386 if (prompt_allocated == NULL) {387 fprintf(stderr, "%s: invalid prompt\n", optarg);388 return EXIT_FAILURE;389 }390 mbstowcs(prompt_allocated, optarg, wlen + 1);391 prompt_content = prompt_allocated;392 break;393 }394 case 'b': {395 uint32_t background;396 if (sscanf(optarg, "%08x", &background) != 1) {397 fprintf(stderr, "%s: invalid color\n", optarg);
134 unmodified lines
532 if ((fdm = fdm_init()) == NULL)533 goto out;534535516 setlocale(LC_CTYPE, "");517536 /* Load applications */537 if ((apps = applications_init()) == NULL)538 goto out;539 if (dmenu_mode) {
6 unmodified lines
546547 if ((render = render_init(&render_options)) == NULL)548 goto out;549532 if ((prompt = prompt_init(L"> ")) == NULL)550 if ((prompt = prompt_init(prompt_content)) == NULL)551 goto out;552553 if ((matches = matches_init(apps)) == NULL)554 goto out;
34 unmodified lines
589 prompt_destroy(prompt);590 fdm_destroy(fdm);591 applications_destroy(apps);592 icon_themes_destroy(themes);593 free(prompt_allocated);594595#if defined(FUZZEL_ENABLE_CAIRO)596 cairo_debug_reset_static_data();597#endif
3 unmodified lines