~kris/suckless

dwm

ref: c69be823b37c10728ba38af5b45956af6fd10a8b dwm/patch/combo.c -rw-r--r-- 642 bytes
c69be823 — Kris Yotam Rebind Mod+m to dmode, add Mod+a for questions, update screenshot/record bindings 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
static int combo = 0;

#if !BAR_HOLDBAR_PATCH
void
keyrelease(XEvent *e)
{
	combo = 0;
}
#endif // !BAR_HOLDBAR_PATCH

void
combotag(const Arg *arg)
{
	if (selmon->sel && arg->ui & TAGMASK) {
		#if SWITCHTAG_PATCH
		if (selmon->sel->switchtag)
			selmon->sel->switchtag = 0;
		#endif // SWITCHTAG_PATCH
		if (combo) {
			selmon->sel->tags |= arg->ui & TAGMASK;
		} else {
			combo = 1;
			selmon->sel->tags = arg->ui & TAGMASK;
		}
		arrange(selmon);
		focus(NULL);
	}
}

void
comboview(const Arg *arg)
{
	if (combo) {
		view(&((Arg) { .ui = selmon->tagset[selmon->seltags] | (arg->ui & TAGMASK) }));
	} else {
		combo = 1;
		view(arg);
	}
}