From a7c4a56c09641eec1765c9664d95f79cb58d4c86 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sat, 26 Mar 2022 14:32:02 -0400 Subject: debloat: spawn and dmenu are handled with dwmc --- config.def.h | 9 +-------- dwm.c | 18 ------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/config.def.h b/config.def.h index 4f4b1b8..80b283e 100644 --- a/config.def.h +++ b/config.def.h @@ -8,7 +8,7 @@ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ static const int user_bh = 0; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ static const char *fonts[] = { "monospace:size=10" }; -static const char dmenufont[] = "monospace:size=10"; +/* static const char dmenufont[] = "monospace:size=10"; */ static const char col_gray1[] = "#222222"; static const char col_gray2[] = "#444444"; static const char col_gray3[] = "#bbbbbb"; @@ -76,15 +76,8 @@ static const Layout layouts[] = { #define STATUSBAR "dwmblocks" -/* commands */ -static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ -static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; -static const char *termcmd[] = { "st", NULL }; - static Key keys[] = { /* modifier key function argument */ - { MODKEY, XK_p, spawn, {.v = dmenucmd } }, - { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, { MODKEY, XK_b, togglebar, {0} }, { MODKEY|ShiftMask, XK_b, focusmaster, {0} }, { MODKEY|ShiftMask, XK_j, rotatestack, {.i = +1 } }, diff --git a/dwm.c b/dwm.c index 3666dc9..e7ed885 100644 --- a/dwm.c +++ b/dwm.c @@ -225,7 +225,6 @@ static void seturgent(Client *c, int urg); static void showhide(Client *c); static void sigchld(int unused); static void sigstatusbar(const Arg *arg); -static void spawn(const Arg *arg); static void tag(const Arg *arg); static void tagmon(const Arg *arg); static void tile(Monitor *); @@ -318,7 +317,6 @@ applydefaultlayouts() if (i < LENGTH(lpm)) { m->lt[0] = &layouts[lpm[i]]; m->lt[1] = &layouts[(lpm[i] + 1)/ LENGTH(layouts)]; - /* m->lt[1] = &layouts[(lpm[i] + 1)/ % LENGTH(layouts)]; */ strncpy(m->ltsymbol, layouts[i].symbol, sizeof m->ltsymbol); } i++; @@ -1976,22 +1974,6 @@ sigstatusbar(const Arg *arg) sigqueue(statuspid, SIGRTMIN+statussig, sv); } -void -spawn(const Arg *arg) -{ - if (arg->v == dmenucmd) - dmenumon[0] = '0' + selmon->num; - if (fork() == 0) { - if (dpy) - close(ConnectionNumber(dpy)); - setsid(); - execvp(((char **)arg->v)[0], (char **)arg->v); - fprintf(stderr, "dwm: execvp %s", ((char **)arg->v)[0]); - perror(" failed"); - exit(EXIT_SUCCESS); - } -} - void tag(const Arg *arg) { -- cgit v1.2.3