Skip to content
Myr

wayland: allow setting namespace in config and from the command line

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

authored by frosty · committed by Daniel Eklöf · parent b789998 · Browse files · 9 files+37 added−2 removed
This commit

State

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

Diff stats

9 files+37 added−2 removed

  • other:+37 added−2 removed

9 files+37 added−2 removed

modified:completions/fish/fuzzel.fish+1 added
9 unmodified lines
1011complete -c fuzzel -f12complete -c fuzzel -r -s c -l config -d "path to configuration file (XDG_CONFIG_HOME/fuzzel/fuzzel.ini)"13complete -c fuzzel -r -l cache -d "file to load most recently launched applications from (XDG_CACHE_HOME/fuzzel)"14complete -c fuzzel -x -s n -l namespace -d "layer shell surface namespace (launcher)"15complete -c fuzzel -l check-config -d "verify configuration and exit with 0 if ok, otherwise exit with 1"16complete -c fuzzel -x -s f -l font -a "(fc-list : family | sed 's/,/\n/g' | sort | uniq)" -d "font name and style in fontconfig format (monospace)"17complete -c fuzzel -l use-bold -d "allow fuzzel to use bold fonts"18complete -c fuzzel -x -s o -l output -a "(__fish_complete_fuzzel_output)" -d "output (monitor) do display on (none)"
64 unmodified lines
modified:completions/zsh/_fuzzel+1 added
2 unmodified lines
3_arguments \4 -s \5 '--config[path to configuration file (XDG_CONFIG_HOME/fuzzel/fuzzel.ini)]:config:_files' \6 '--cache[file to load most recently launched applications from (XDG_CACHE_HOME/fuzzel)]:cache:_files' \7 '(-n --namespace)'{-n,--namespace}'[layer shell surface namespace (launcher)]:()' \8 '--check-config[verify configuration and exit with 0 if ok, otherwise exit with 1]' \9 '(-v --version)'{-v,--version}'[show the version number and quit]' \10 '(-h --help)'{-h,--help}'[show help message and quit]' \11 '(-o --output)'{-o,--output}'[output (monitor) to display on (none)]:output:->outputs' \
81 unmodified lines
modified:doc/fuzzel.1.scd+7 added
23 unmodified lines
24*--check-config*25 Verify configuration and then exit with 0 if ok, otherwise exit26 with 1.2728*-n*,*--namespace*=_NAMESPACE_29 Specifies the namespace for the spawned layer shell surface. Useful for30 blocking fuzzel out from screencasts in your compositor if it shows31 sensitive information, such as passwords.3233 Default: _launcher_3435*--cache*=_PATH_36 Use a custom cache location. Fuzzel uses this file to cache the37 most commonly launched applications (to be able to sort them at38 the top).
469 unmodified lines
modified:doc/fuzzel.ini.5.scd+7 added
37 unmodified lines
38 - Nested imports are allowed.39 40 Default: _not set_.4142*namespace*43 Namespace for the spawned layer shell surface. Useful for blocking44 fuzzel out from screencasts in your compositor if it shows sensitive45 information, such as passwords.4647 Default: _launcher_4849*output*50 Output (monitor) to display on. You can list the available outputs51 with *wlr-randr* or with Sway using *swaymsg -t get_outputs*.52
526 unmodified lines
modified:CHANGELOG.md+2 added
32 unmodified lines
33### Added3435* Add support for fallback icons in dmenu mode using comma-separated36 values in the icon metadata ([#504][504]).37* `--namespace` command line option ([#512][512]).3839[504]: https://codeberg.org/dnkl/fuzzel/pulls/50440[512]: https://codeberg.org/dnkl/fuzzel/pulls/512414243### Changed44
925 unmodified lines
modified:config.c+5 added
755 unmodified lines
756 free(_include_path);757 return ret;758 }759760 else if (strcmp(key, "namespace") == 0)761 return value_to_str(ctx, &conf->namespace);762763 else if (strcmp(key, "output") == 0)764 return value_to_str(ctx, &conf->output);765766 else if (strcmp(key, "font") == 0)
823 unmodified lines
1590{1591 bool ret = !errors_are_fatal;1592 *conf = (struct config) {1593 .output = NULL,1594 .namespace = xstrdup("launcher"),1595 .prompt = xc32dup(U"> "),1596 .placeholder = xc32dup(U""),1597 .search_text = xc32dup(U""),1598 .match_fields = MATCH_FILENAME | MATCH_NAME | MATCH_GENERIC,
125 unmodified lines
17241725void1726config_free(struct config *conf)1727{1728 free(conf->namespace);1729 free(conf->output);1730 free(conf->prompt);1731 free(conf->placeholder);1732 free(conf->search_text);
18 unmodified lines
modified:config.h+2 added
103 unmodified lines
104 char32_t *search_text;105 bool prompt_only;106 enum match_fields match_fields;107108 char *namespace;109110 struct {111 char32_t character;112 bool enabled;113 bool character_set;
102 unmodified lines
modified:main.c+11 added-1 removed
324 unmodified lines
325 " --check-config verify configuration, exit with 0 if ok,\n"326 " otherwise exit with 1\n"327 " --cache=PATH load most recently launched applications from\n"328 " PATH (XDG_CACHE_HOME/fuzzel)\n"329 " -n,--namespace=NAMESPACE layer shell surface namespace\n"330 " -o,--output=OUTPUT output (monitor) to display on (none)\n"331 " -f,--font=FONT font name and style, in FontConfig format\n"332 " (monospace)\n"333 " --use-bold allow fuzzel to use bold fonts\n"
424 unmodified lines
758759 static const struct option longopts[] = {760 {"config", required_argument, 0, OPT_CONFIG},761 {"check-config", no_argument, 0, OPT_CHECK_CONFIG},762 {"namespace", required_argument, 0, 'n'},763 {"cache", required_argument, 0, OPT_CACHE},764 {"output" , required_argument, 0, 'o'},765 {"font", required_argument, 0, 'f'},766 {"use-bold", no_argument, 0, OPT_USE_BOLD},
148 unmodified lines
915 free(copy);916 }917918 while (true) {917 int c = getopt_long(argc, argv, ":o:f:D:IF:ia:l:w:x:y:p:P:b:t:m:s:S:M:B:r:C:T:dRvh", longopts, NULL);919 int c = getopt_long(argc, argv, ":n:o:f:D:IF:ia:l:w:x:y:p:P:b:t:m:s:S:M:B:r:C:T:dRvh", longopts, NULL);920 if (c == -1)921 break;922923 switch (c) {
4 unmodified lines
928 case OPT_CHECK_CONFIG:929 check_config = true;930 break;931932 case 'n':933 cmdline_overrides.conf.namespace = optarg;934 break;935936 case OPT_CACHE:937 cmdline_overrides.conf.cache_path = optarg;938 break;939
787 unmodified lines
1727 if (cmdline_overrides.conf.output != NULL) {1728 free(conf.output);1729 conf.output = xstrdup(cmdline_overrides.conf.output);1730 }1731 if (cmdline_overrides.conf.namespace != NULL) {1732 free(conf.namespace);1733 conf.namespace = xstrdup(cmdline_overrides.conf.namespace);1734 }1735 if (cmdline_overrides.conf.prompt != NULL) {1736 free(conf.prompt);1737 conf.prompt = cmdline_overrides.conf.prompt;1738 if (cmdline_overrides.prompt_only_set)
350 unmodified lines
modified:wayland.c+1 added-1 removed
2378 unmodified lines
23792380 wayl->layer_surface = zwlr_layer_shell_v1_get_layer_surface(2381 wayl->layer_shell, wayl->surface,2382 wayl->monitor != NULL ? wayl->monitor->output : NULL,2383 conf->layer, "launcher");2383 conf->layer, conf->namespace);23842385 if (wayl->layer_surface == NULL) {2386 LOG_ERR("failed to create layer shell surface");2387 goto out;
136 unmodified lines