applied improved version of Martti Kühne's dmenu/multi monitor approach from dwm, no dmenuspawn required 6af27377
Anselm R Garbe · 2013-08-02 22:40 2 file(s) · +4 −1
config.def.h +2 −1
50 50
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
51 51
52 52
/* commands */
53 -
static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
53 +
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
54 +
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL };
54 55
static const char *termcmd[]  = { "st", NULL };
55 56
56 57
static Key keys[] = {
dwm.c +2 −0
1569 1569
1570 1570
void
1571 1571
spawn(const Arg *arg) {
1572 +
	if(arg->v == dmenucmd)
1573 +
		dmenumon[0] = '0' + selmon->num;
1572 1574
	if(fork() == 0) {
1573 1575
		if(dpy)
1574 1576
			close(ConnectionNumber(dpy));