Adding tagothermonitor patch

This commit is contained in:
matt
2020-06-19 23:18:50 +02:00
parent 5e0a9c49f8
commit 6aca089661
9 changed files with 79 additions and 4 deletions

View File

@ -40,6 +40,20 @@ tagallex(const Arg *arg)
tag(&((Arg){.ui = ~0}));
}
#if TAGOTHERMONITOR_PATCH
void
tagnextmonex(const Arg *arg)
{
tagnextmon(&((Arg) { .ui = 1 << arg->ui }));
}
void
tagprevmonex(const Arg *arg)
{
tagprevmon(&((Arg) { .ui = 1 << arg->ui }));
}
#endif
int
fake_signal(void)
{
@ -81,4 +95,4 @@ fake_signal(void)
// No fake signal was sent, so proceed with update
return 0;
}
}

View File

@ -10,4 +10,8 @@ static void toggleviewex(const Arg *arg);
static void tagex(const Arg *arg);
static void toggletagex(const Arg *arg);
static void tagallex(const Arg *arg);
static int fake_signal(void);
#if TAGOTHERMONITOR_PATCH
static void tagnextmonex(const Arg *arg);
static void tagprevmonex(const Arg *arg);
#endif
static int fake_signal(void);

View File

@ -164,6 +164,9 @@
#if TAGGRID_PATCH
#include "taggrid.c"
#endif
#if TAGOTHERMONITOR_PATCH
#include "tagothermonitor.c"
#endif
#if TAGSWAPMON_PATCH
#include "tagswapmon.c"
#endif
@ -245,4 +248,4 @@
#endif
#if TILE_LAYOUT
#include "tile.c"
#endif
#endif

View File

@ -164,6 +164,9 @@
#if TAGGRID_PATCH
#include "taggrid.h"
#endif
#if TAGOTHERMONITOR_PATCH
#include "tagothermonitor.h"
#endif
#if TAGSWAPMON_PATCH
#include "tagswapmon.h"
#endif
@ -239,4 +242,4 @@
#endif
#if TILE_LAYOUT
#include "tile.h"
#endif
#endif

29
patch/tagothermonitor.c Normal file
View File

@ -0,0 +1,29 @@
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;
focus(NULL);
arrange(newmon);
}
}

3
patch/tagothermonitor.h Normal file
View File

@ -0,0 +1,3 @@
static void tagnextmon(const Arg *arg);
static void tagprevmon(const Arg *arg);
static void tagothermon(const Arg *arg, int dir);