diff options
author | Jari Vetoniemi <mailRoxas@gmail.com> | 2019-06-01 22:09:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-01 22:09:52 +0300 |
commit | 572470ef8cc4725728b239fe5fa65f62f9d70dd4 (patch) | |
tree | 8fa42cf9f947df05dc5ee872f847deac2113a880 /client/common/common.c | |
parent | dac040f659fe90a520591e7179de19d6279e4d29 (diff) | |
parent | 93cde4831bca7055c38a1d6246fdcb84df07f7ec (diff) | |
download | bemenu-572470ef8cc4725728b239fe5fa65f62f9d70dd4.tar.gz bemenu-572470ef8cc4725728b239fe5fa65f62f9d70dd4.tar.bz2 bemenu-572470ef8cc4725728b239fe5fa65f62f9d70dd4.zip |
Merge pull request #57 from alyssais/line-height
bemenu: add --line-height / -H option
Diffstat (limited to 'client/common/common.c')
-rw-r--r-- | client/common/common.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/common/common.c b/client/common/common.c index a82aedb..9e5c297 100644 --- a/client/common/common.c +++ b/client/common/common.c @@ -86,6 +86,7 @@ usage(FILE *out, const char *name) " -f, --grab show the menu before reading stdin. (wx)\n" " -n, --no-overlap adjust geometry to not overlap with panels. (w)\n" " -m, --monitor index of monitor where menu will appear. (x)\n" + " -H, --line-height defines the height to make each menu line (0 = default height). (wx)\n" " --fn defines the font to be used ('name [size]'). (wx)\n" " --tb defines the title background color. (wx)\n" " --tf defines the title foreground color. (wx)\n" @@ -125,6 +126,7 @@ parse_args(struct client *client, int *argc, char **argv[]) { "grab", no_argument, 0, 'f' }, { "no-overlap", no_argument, 0, 'n' }, { "monitor", required_argument, 0, 'm' }, + { "line-height", required_argument, 0, 'H' }, { "fn", required_argument, 0, 0x101 }, { "tb", required_argument, 0, 0x102 }, { "tf", required_argument, 0, 0x103 }, @@ -148,7 +150,7 @@ parse_args(struct client *client, int *argc, char **argv[]) * or parse them before running getopt.. */ for (;;) { - int32_t opt = getopt_long(*argc, *argv, "hviwl:I:p:P:I:bfm:n", opts, NULL); + int32_t opt = getopt_long(*argc, *argv, "hviwl:I:p:P:I:bfm:H:n", opts, NULL); if (opt < 0) break; @@ -198,6 +200,9 @@ parse_args(struct client *client, int *argc, char **argv[]) client->no_overlap = true; break; + case 'H': + client->line_height = strtol(optarg, NULL, 10); + break; case 0x101: client->font = optarg; break; @@ -262,6 +267,7 @@ menu_with_options(const struct client *client) return NULL; bm_menu_set_font(menu, client->font); + bm_menu_set_line_height(menu, client->line_height); bm_menu_set_title(menu, client->title); bm_menu_set_prefix(menu, client->prefix); bm_menu_set_filter_mode(menu, client->filter_mode); |