~kris/suckless

dwm

ref: 556b5fa40e27afcbdce9e4b7375b33bdd9f1a69f dwm/patch/tagothermonitor.c -rw-r--r-- 638 bytes
556b5fa4 — Kris Yotam swap focused/unfocused border colors: pale cyan focused, teal unfocused 2 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
40
41
42
43
44
#if IPC_PATCH || DWMC_PATCH
void
tagnextmonex(const Arg *arg)
{
	tagnextmon(&((Arg) { .ui = 1 << arg->ui }));
}

void
tagprevmonex(const Arg *arg)
{
	tagprevmon(&((Arg) { .ui = 1 << arg->ui }));
}
#endif // IPC_PATCH | DWMC_PATCH

void
tagnextmon(const Arg *arg)
{
	tagothermon(arg, 1);
}

void
tagprevmon(const Arg *arg)
{
	tagothermon(arg, -1);
}

void
tagothermon(const Arg *arg, int dir)
{
	Client *sel;
	Monitor *newmon;

	if (!selmon->sel || !mons->next)
		return;
	sel = selmon->sel;
	newmon = dirtomon(dir);
	sendmon(sel, newmon);
	if (arg->ui & TAGMASK) {
		sel->tags = arg->ui & TAGMASK;
		arrange(newmon);
		focus(NULL);
	}
}