summaryrefslogtreecommitdiff
path: root/dwm
diff options
context:
space:
mode:
Diffstat (limited to 'dwm')
-rw-r--r--dwm/config.def.h10
-rw-r--r--dwm/drw.h2
-rw-r--r--dwm/dwm.c72
3 files changed, 46 insertions, 38 deletions
diff --git a/dwm/config.def.h b/dwm/config.def.h
index d5e4457..5f33d7b 100644
--- a/dwm/config.def.h
+++ b/dwm/config.def.h
@@ -54,7 +54,7 @@ static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444";
static char normfgcolor[] = "#bbbbbb";
static char normfloatcolor[] = "#330000";
-static char normmarkcolor[] = "#b16286";
+static char normmarkcolor[] = "#550000";
static char norminfobgcolor[] = "#222222";
static char norminfofgcolor[] = "#f8f8f2";
static char normstatusbgcolor[] = "#222222";
@@ -65,7 +65,7 @@ static char selbgcolor[] = "#005577";
static char selbordercolor[] = "#770000";
static char selfgcolor[] = "#eeeeee";
static char selfloatcolor[] = "#770000";
-static char selmarkcolor[] = "#770000";
+static char selmarkcolor[] = "#aa0000";
static char selinfobgcolor[] = "#005577";
static char selinfofgcolor[] = "#eeeeee";
static char selstatusbgcolor[] = "#222222";
@@ -582,9 +582,9 @@ static Keychord *keychords[] = {
&((Keychord){1, {{WINMOD, XK_Right}}, shiftswaptags, {.i = +1 } }),
&((Keychord){1, {{WINMODALL, XK_Left}}, shiftboth, {.i = -1 } }),
&((Keychord){1, {{WINMODALL, XK_Right}}, shiftboth, {.i = +1 } }),
- &((Keychord){1, {{ALTKEY, XK_Tab}}, swapfocus, {0} }),
- &((Keychord){1, {{ALTMOD2, XK_Tab}}, swapfocus, {0} }),
- &((Keychord){1, {{ALTMOD, XK_Tab}}, swapclient, {0} }),
+ &((Keychord){1, {{ALTKEY, XK_Tab}}, view, {0} }),
+ &((Keychord){1, {{ALTMOD, XK_Tab}}, swapfocus, {0} }),
+ &((Keychord){1, {{ALTMOD2, XK_Tab}}, swapclient, {0} }),
&((Keychord){1, {{ALTMODALL, XK_Tab}}, alttab, {0} }),
&((Keychord){1, {{WINKEY, XK_bracketleft}}, shiftview, {.i = -1 } }),
&((Keychord){1, {{WINKEY, XK_bracketright}}, shiftview, {.i = +1 } }),
diff --git a/dwm/drw.h b/dwm/drw.h
index c0ca5a8..5e802a9 100644
--- a/dwm/drw.h
+++ b/dwm/drw.h
@@ -12,7 +12,7 @@ typedef struct Fnt {
struct Fnt *next;
} Fnt;
-enum { ColFg, ColBg, ColBorder, ColMark }; /* Clr scheme index */
+enum { ColFg, ColBg, ColBorder, ColFloat, ColMark }; /* Clr scheme index */
typedef XftColor Clr;
typedef struct {
diff --git a/dwm/dwm.c b/dwm/dwm.c
index 99a1d42..594ffe7 100644
--- a/dwm/dwm.c
+++ b/dwm/dwm.c
@@ -73,11 +73,10 @@
#define TAGMASK ((1 << NUMTAGS) - 1)
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
#define TRUNC(X,A,B) (MAX((A), MIN((X), (B))))
-#define ColFloat 3
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeInv, SchemeSel, SchemeStatusSel, SchemeStatusNorm, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeInv, SchemeStatusNorm, SchemeStatusSel, SchemeTagsNorm, SchemeTagsSel, SchemeInfoNorm, SchemeInfoSel }; /* color schemes */
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMFullscreen, NetWMSticky, NetActiveWindow, NetWMWindowType,
NetWMWindowTypeDialog, NetClientList, NetWMWindowsOpacity, NetClientInfo, NetLast }; /* EWMH atoms */
@@ -2860,37 +2859,46 @@ setclienttagprop(Client *c)
void
swapclient(const Arg *arg)
{
- Client *s, *m, t;
+ if (!selmon || !selmon->sel || !mons->next)
+ return;
- if (!mark || !selmon->sel || mark == selmon->sel
- || !selmon->lt[selmon->sellt]->arrange)
- return;
- s = selmon->sel;
- m = mark;
- t = *s;
- strcpy(s->name, m->name);
- s->win = m->win;
- s->x = m->x;
- s->y = m->y;
- s->w = m->w;
- s->h = m->h;
-
- m->win = t.win;
- strcpy(m->name, t.name);
- m->x = t.x;
- m->y = t.y;
- m->w = t.w;
- m->h = t.h;
-
- selmon->sel = m;
- mark = s;
- focus(s);
- setmark(m);
-
- arrange(s->mon);
- if (s->mon != m->mon) {
- arrange(m->mon);
- }
+ Monitor *m1 = selmon;
+ Monitor *m2 = dirtomon(+1);
+
+ Client *c1 = m1->sel;
+ Client *c2 = m2->sel;
+
+ if (!c2) {
+ detach(c1);
+ detachstack(c1);
+ c1->mon = m2;
+ attach(c1);
+ attachstack(c1);
+ focus(c1);
+ selmon = m2;
+ arrange(m1);
+ arrange(m2);
+ return;
+ }
+
+ detach(c1);
+ detachstack(c1);
+ detach(c2);
+ detachstack(c2);
+
+ c1->mon = m2;
+ attach(c1);
+ attachstack(c1);
+ focus(c1);
+
+ c2->mon = m1;
+ attach(c2);
+ attachstack(c2);
+ focus(c2);
+
+ selmon = m1;
+ arrange(m1);
+ arrange(m2);
}
void