Skip to content
Myr

main: enable dmenu-mode if invoked with argv[0] == dmenu

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

Closes #107

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 708dec8 · Browse files · 3 files+21 added−0 removed
This commit

State

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

Diff stats

3 files+21 added−0 removed

  • other:+21 added−0 removed

3 files+21 added−0 removed

modified:doc/fuzzel.scd+4 added
179 unmodified lines
180 dmenu compatibility mode. In this mode, the list entries are read181 from stdin (newline separated). The selected entry is printed to182 stdout. If the input string does not match any of the entries, the183 input string is printed as is on stdout.184 185 Alternatively, you can symlink the fuzzel binary to186 *dmenu*. Fuzzel will then start in dmenu mode, without the187 *--dmenu* argument.188189*--index*190 Print selected entry's index instead of its text. **dmenu** mode191 only.
50 unmodified lines
modified:CHANGELOG.md+5 added
16 unmodified lines
17* [1.4.1](#1-4-1)181920## Unreleased2122### Added2324* If `argv[0]` is _dmenu_, fuzzel now starts in dmenu mode25 (https://codeberg.org/dnkl/fuzzel/issues/107).262728### Changed2930* Minimum required meson version is now 0.58.31* libpng warnings are now routed through fuzzel’s logging
308 unmodified lines
modified:main.c+12 added
559 unmodified lines
560 };561562 setlocale(LC_CTYPE, "");563564 /* Auto-enable dmenu mode if invoked through a ‘dmenu’ symlink */565 if (argv[0] != NULL) {566 char *copy = strdup(argv[0]);567 if (copy != NULL) {568 const char *name = basename(copy);569 if (name != NULL && strcmp(name, "dmenu") == 0)570 dmenu_mode = true;571572 free(copy);573 }574 }575576 while (true) {577 int c = getopt_long(argc, argv, ":o:f:D:i:IF:l:w:x:y:p:P:b:t:m:s:S:B:r:C:T:dRvh", longopts, NULL);578 if (c == -1)579 break;
515 unmodified lines