Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.4 KiB

4 years ago
  1. diff --git a/dmenu.1 b/dmenu.1
  2. index 9eab758..b4947f9 100644
  3. --- a/dmenu.1
  4. +++ b/dmenu.1
  5. @@ -22,6 +22,8 @@ dmenu \- dynamic menu
  6. .IR color ]
  7. .RB [ \-w
  8. .IR windowid ]
  9. +.RB [ \-it
  10. +.IR text ]
  11. .P
  12. .BR dmenu_run " ..."
  13. .SH DESCRIPTION
  14. @@ -80,6 +82,9 @@ prints version information to stdout, then exits.
  15. .TP
  16. .BI \-w " windowid"
  17. embed into windowid.
  18. +.TP
  19. +.BI \-it " text".
  20. +start with initial text input.
  21. .SH USAGE
  22. dmenu is completely controlled by the keyboard. Items are selected using the
  23. arrow keys, page up, page down, home, and end.
  24. diff --git a/dmenu.c b/dmenu.c
  25. index d605ab4..0564dfe 100644
  26. --- a/dmenu.c
  27. +++ b/dmenu.c
  28. @@ -637,7 +637,8 @@ static void
  29. usage(void)
  30. {
  31. fputs("usage: dmenu [-bfiv] [-l lines] [-p prompt] [-fn font] [-m monitor]\n"
  32. - " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n", stderr);
  33. + " [-nb color] [-nf color] [-sb color] [-sf color] [-w windowid]\n"
  34. + " [-it text]\n", stderr);
  35. exit(1);
  36. }
  37. @@ -680,7 +681,10 @@ main(int argc, char *argv[])
  38. colors[SchemeSel][ColFg] = argv[++i];
  39. else if (!strcmp(argv[i], "-w")) /* embedding window id */
  40. embed = argv[++i];
  41. - else
  42. + else if (!strcmp(argv[i], "-it")) { /* embedding window id */
  43. + const char * text = argv[++i];
  44. + insert(text, strlen(text));
  45. + } else
  46. usage();
  47. if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())