From 1ee2efb9667af35d5e5ccfea6824701c2fdbce44 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Mon, 9 Jul 2018 18:42:25 -0700 Subject: hardcode commands for now until I have a config format --- cmdtree.c | 4 +--- command.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/cmdtree.c b/cmdtree.c index bed203c..74dc15a 100644 --- a/cmdtree.c +++ b/cmdtree.c @@ -72,7 +72,7 @@ setup(Drw *drw) parentwin); int vertwidth = 200; mw = wa.width; - mh = (lines + 1) * bh; + mh = 1 * bh; switch (position) { case POSITION_BOTTOM: y = wa.height - mh; @@ -95,8 +95,6 @@ setup(Drw *drw) mw = vertwidth; mh = wa.height; } - lines = 3; - lines = MAX(lines, 0); sep_width = drw_fontset_getwidth(drw, separator); swa.override_redirect = True; diff --git a/command.c b/command.c index c457e43..de1ec97 100644 --- a/command.c +++ b/command.c @@ -36,20 +36,28 @@ command_lookup(struct command *cmd, int ncmds, const char *binding) { return NULL; } -static struct command emacs_commands[] = { - { .bind = "d", .name = "emacs-dev", .nchildren = 0, .children = NULL }, +/* static struct command emacs_commands[] = { */ +/* { .bind = "d", .name = "emacs-dev", .nchildren = 0, .children = NULL }, */ +/* }; */ + +static struct command browser_commands[] = { + { .bind = "s", .name = "chrome", .nchildren = 0, .children = NULL }, + { .bind = "c", .name = "chromium", .nchildren = 0, .children = NULL }, + { .bind = "f", .name = "firefox", .nchildren = 0, .children = NULL }, }; static const struct command examples[] = { - { .bind = "f", .name = "firefox", .nchildren = 0, .children = NULL }, + { .bind = "b", + .name = "browsers", + .nchildren = LENGTH(browser_commands), + .children = browser_commands + }, { .bind = "e", - .name = "emacs", - .children = emacs_commands, - .nchildren = LENGTH(emacs_commands) + .name = "emacs-dev", + .children = NULL, + .nchildren = 0 }, - - { .bind = "N", .name = "networking", .nchildren = 0, .children = NULL }, }; struct command * -- cgit v1.2.3