diff --git a/.gitignore b/.gitignore index 5761abc..095e840 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.o +dwm diff --git a/config.h b/config.h index 4d02764..95bf4a9 100644 --- a/config.h +++ b/config.h @@ -25,8 +25,7 @@ static const int lcaselbl = 0; /* 1 means make tag label lowerc static int tagindicatortype = INDICATOR_TOP_LEFT_SQUARE; static int tiledindicatortype = INDICATOR_NONE; static int floatindicatortype = INDICATOR_TOP_LEFT_SQUARE; -static const char font[] = "monospace 10"; -static const char dmenufont[] = "monospace:size=10"; +static const char font[] = "monospace 8"; static char c000000[] = "#000000"; // placeholder value @@ -346,6 +345,8 @@ static const Key keys[] = { { MODKEY, XK_period, focusmon, {.i = +1 } }, { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, + { MODKEY|Mod1Mask|ControlMask, XK_comma, tagswapmon, {.i = +1 } }, + { MODKEY|Mod1Mask|ControlMask, XK_period, tagswapmon, {.i = -1 } }, TAGKEYS( XK_1, 0) TAGKEYS( XK_2, 1) TAGKEYS( XK_3, 2) diff --git a/dwm b/dwm deleted file mode 100755 index c53b774..0000000 Binary files a/dwm and /dev/null differ diff --git a/libs/include.c b/libs/include.c index 579906c..c75df16 100644 --- a/libs/include.c +++ b/libs/include.c @@ -28,6 +28,7 @@ #include "vanitygaps.c" #include "xrdb.c" #include "dragmfact.c" +#include "swap.c" /* Layouts */ #include "layout_facts.c" #include "layout_flextile-deluxe.c" diff --git a/libs/include.h b/libs/include.h index 76dc9c5..d3215f8 100644 --- a/libs/include.h +++ b/libs/include.h @@ -28,6 +28,7 @@ #include "swallow.h" #include "vanitygaps.h" #include "xrdb.h" +#include "swap.h" /* Layouts */ #include "layout_flextile-deluxe.h" #include "layout_monocle.h" diff --git a/libs/swap.c b/libs/swap.c new file mode 100644 index 0000000..2489a1b --- /dev/null +++ b/libs/swap.c @@ -0,0 +1,61 @@ +void +tagswapmon(const Arg *arg) +{ + Monitor *m; + Client *c, *sc = NULL, *mc = NULL, *next; + + if (!mons->next) + return; + + m = dirtomon(arg->i); + + for (c = selmon->clients; c; c = next) { + next = c->next; + if (!ISVISIBLE(c)) + continue; + unfocus(c, 1, NULL); + detach(c); + detachstack(c); + c->next = sc; + sc = c; + } + + for (c = m->clients; c; c = next) { + next = c->next; + if (!ISVISIBLE(c)) + continue; + unfocus(c, 1, NULL); + detach(c); + detachstack(c); + c->next = mc; + mc = c; + } + + for (c = sc; c; c = next) { + next = c->next; + c->mon = m; + c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */ + attach(c); + attachstack(c); + if (c->isfullscreen) { + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } + } + + for (c = mc; c; c = next) { + next = c->next; + c->mon = selmon; + c->tags = selmon->tagset[selmon->seltags]; /* assign tags of target monitor */ + attach(c); + attachstack(c); + if (c->isfullscreen) { + resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); + XRaiseWindow(dpy, c->win); + } + } + + arrange(NULL); + focus(NULL); +} + diff --git a/libs/swap.h b/libs/swap.h new file mode 100644 index 0000000..80db6f4 --- /dev/null +++ b/libs/swap.h @@ -0,0 +1 @@ +static void tagswapmon(const Arg *arg);