Compare commits
2 Commits
patched-2
...
9b94466297
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b94466297 | ||
| d0e421c6da |
@@ -1,4 +1,5 @@
|
|||||||
/* See LICENSE file for copyright and license details. */
|
/* See LICENSE file for copyright and license details. */
|
||||||
|
#include "gaplessgrid.c"
|
||||||
|
|
||||||
/* appearance */
|
/* appearance */
|
||||||
static const unsigned int borderpx = 1; /* border pixel of windows */
|
static const unsigned int borderpx = 1; /* border pixel of windows */
|
||||||
@@ -51,6 +52,7 @@ static const Layout layouts[] = {
|
|||||||
{ "[]=", tile }, /* first entry is default */
|
{ "[]=", tile }, /* first entry is default */
|
||||||
{ "><>", NULL }, /* no layout function means floating behavior */
|
{ "><>", NULL }, /* no layout function means floating behavior */
|
||||||
{ "[M]", monocle },
|
{ "[M]", monocle },
|
||||||
|
{ "HHH", gaplessgrid },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* key definitions */
|
/* key definitions */
|
||||||
@@ -72,6 +74,7 @@ static const char *termcmd[] = { "st", NULL };
|
|||||||
#include "shift-tools.c"
|
#include "shift-tools.c"
|
||||||
|
|
||||||
#include "exitdwm.c"
|
#include "exitdwm.c"
|
||||||
|
#include "movestack.c"
|
||||||
static const Key keys[] = {
|
static const Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ MODKEY, XK_p, spawndmenu, {0} },
|
{ MODKEY, XK_p, spawndmenu, {0} },
|
||||||
@@ -93,6 +96,8 @@ static const Key keys[] = {
|
|||||||
{ MODKEY|ControlMask, XK_l, shiftswaptags, { .i = +1 } },
|
{ MODKEY|ControlMask, XK_l, shiftswaptags, { .i = +1 } },
|
||||||
{ MODKEY|ShiftMask, XK_l, shiftboth, { .i = +1 } },
|
{ MODKEY|ShiftMask, XK_l, shiftboth, { .i = +1 } },
|
||||||
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
{ MODKEY, XK_l, setmfact, {.f = +0.05} },
|
||||||
|
{ MODKEY|ShiftMask, XK_j, movestack, {.i = +1 } },
|
||||||
|
{ MODKEY|ShiftMask, XK_k, movestack, {.i = -1 } },
|
||||||
{ MODKEY, XK_Return, zoom, {0} },
|
{ MODKEY, XK_Return, zoom, {0} },
|
||||||
{ MODKEY, XK_Tab, view, {0} },
|
{ MODKEY, XK_Tab, view, {0} },
|
||||||
{ MODKEY, XK_g, goback, {0} },
|
{ MODKEY, XK_g, goback, {0} },
|
||||||
@@ -131,6 +136,9 @@ static const Key keys[] = {
|
|||||||
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
{ MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} },
|
{ MODKEY|ControlMask|ShiftMask, XK_q, quit, {1} },
|
||||||
{ MODKEY|ShiftMask, XK_e, exitdwm, {0} },
|
{ MODKEY|ShiftMask, XK_e, exitdwm, {0} },
|
||||||
|
{ MODKEY, XK_o, winview, {0} },
|
||||||
|
{ MODKEY, XK_g, gridall, {} },
|
||||||
|
{ MODKEY, XK_r, winviewmono, {} },
|
||||||
};
|
};
|
||||||
|
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
|
|||||||
3
dwm.1
3
dwm.1
@@ -110,6 +110,9 @@ Increase master area size.
|
|||||||
.B Mod1\-h
|
.B Mod1\-h
|
||||||
Decrease master area size.
|
Decrease master area size.
|
||||||
.TP
|
.TP
|
||||||
|
.B Mod1\-o
|
||||||
|
Select view of the window in focus. The list of tags to be displayed is matched to the window tag list.
|
||||||
|
.TP
|
||||||
.B Mod1\-Return
|
.B Mod1\-Return
|
||||||
Zooms/cycles focused window to/from master area (tiled layouts only).
|
Zooms/cycles focused window to/from master area (tiled layouts only).
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
38
dwm.c
38
dwm.c
@@ -250,10 +250,13 @@ static void view(const Arg *arg);
|
|||||||
static void warp(const Client *c);
|
static void warp(const Client *c);
|
||||||
static Client *wintoclient(Window w);
|
static Client *wintoclient(Window w);
|
||||||
static Monitor *wintomon(Window w);
|
static Monitor *wintomon(Window w);
|
||||||
|
static void winview(const Arg* arg);
|
||||||
static int xerror(Display *dpy, XErrorEvent *ee);
|
static int xerror(Display *dpy, XErrorEvent *ee);
|
||||||
static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
static int xerrordummy(Display *dpy, XErrorEvent *ee);
|
||||||
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
static int xerrorstart(Display *dpy, XErrorEvent *ee);
|
||||||
static void zoom(const Arg *arg);
|
static void zoom(const Arg *arg);
|
||||||
|
static void gridall(const Arg *arg);
|
||||||
|
static void winviewmono(const Arg *arg);
|
||||||
|
|
||||||
/* variables */
|
/* variables */
|
||||||
static const char broken[] = "broken";
|
static const char broken[] = "broken";
|
||||||
@@ -2496,6 +2499,41 @@ wintomon(Window w)
|
|||||||
return selmon;
|
return selmon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Selects for the view of the focused window. The list of tags */
|
||||||
|
/* to be displayed is matched to the focused window tag list. */
|
||||||
|
void
|
||||||
|
winview(const Arg* arg){
|
||||||
|
Window win, win_r, win_p, *win_c;
|
||||||
|
unsigned nc;
|
||||||
|
int unused;
|
||||||
|
Client* c;
|
||||||
|
Arg a;
|
||||||
|
|
||||||
|
if (!XGetInputFocus(dpy, &win, &unused)) return;
|
||||||
|
while(XQueryTree(dpy, win, &win_r, &win_p, &win_c, &nc)
|
||||||
|
&& win_p != win_r) win = win_p;
|
||||||
|
|
||||||
|
if (!(c = wintoclient(win))) return;
|
||||||
|
|
||||||
|
a.ui = c->tags;
|
||||||
|
view(&a);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* by desgua */
|
||||||
|
void
|
||||||
|
gridall(const Arg *arg)
|
||||||
|
{
|
||||||
|
setlayout(&(Arg){.v = &layouts[3]});
|
||||||
|
view(&(Arg){.ui = ~0});
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
winviewmono(const Arg *arg)
|
||||||
|
{
|
||||||
|
winview(&(Arg){0});
|
||||||
|
setlayout(&(Arg){.v = &layouts[2]});
|
||||||
|
}
|
||||||
|
|
||||||
/* There's no way to check accesses to destroyed windows, thus those cases are
|
/* There's no way to check accesses to destroyed windows, thus those cases are
|
||||||
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs
|
* ignored (especially on UnmapNotify's). Other types of errors call Xlibs
|
||||||
* default error handler, which may call exit. */
|
* default error handler, which may call exit. */
|
||||||
|
|||||||
48
movestack.c
Normal file
48
movestack.c
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
void
|
||||||
|
movestack(const Arg *arg) {
|
||||||
|
Client *c = NULL, *p = NULL, *pc = NULL, *i;
|
||||||
|
|
||||||
|
if(arg->i > 0) {
|
||||||
|
/* find the client after selmon->sel */
|
||||||
|
for(c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
|
||||||
|
if(!c)
|
||||||
|
for(c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* find the client before selmon->sel */
|
||||||
|
for(i = selmon->clients; i != selmon->sel; i = i->next)
|
||||||
|
if(ISVISIBLE(i) && !i->isfloating)
|
||||||
|
c = i;
|
||||||
|
if(!c)
|
||||||
|
for(; i; i = i->next)
|
||||||
|
if(ISVISIBLE(i) && !i->isfloating)
|
||||||
|
c = i;
|
||||||
|
}
|
||||||
|
/* find the client before selmon->sel and c */
|
||||||
|
for(i = selmon->clients; i && (!p || !pc); i = i->next) {
|
||||||
|
if(i->next == selmon->sel)
|
||||||
|
p = i;
|
||||||
|
if(i->next == c)
|
||||||
|
pc = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* swap c and selmon->sel selmon->clients in the selmon->clients list */
|
||||||
|
if(c && c != selmon->sel) {
|
||||||
|
Client *temp = selmon->sel->next==c?selmon->sel:selmon->sel->next;
|
||||||
|
selmon->sel->next = c->next==selmon->sel?c:c->next;
|
||||||
|
c->next = temp;
|
||||||
|
|
||||||
|
if(p && p != c)
|
||||||
|
p->next = c;
|
||||||
|
if(pc && pc != selmon->sel)
|
||||||
|
pc->next = selmon->sel;
|
||||||
|
|
||||||
|
if(selmon->sel == selmon->clients)
|
||||||
|
selmon->clients = c;
|
||||||
|
else if(c == selmon->clients)
|
||||||
|
selmon->clients = selmon->sel;
|
||||||
|
|
||||||
|
arrange(selmon);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user