Compare commits
No commits in common. "15739277f5fddcf74ad4824e4d667bced0deba41" and "7d9873cf1ad280a473862c251b52f6ce37384777" have entirely different histories.
15739277f5
...
7d9873cf1a
34
config.def.h
34
config.def.h
@ -11,8 +11,8 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
|
|||||||
static const int showsystray = 1; /* 0 means no systray */
|
static const int showsystray = 1; /* 0 means no systray */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 0; /* 0 means bottom bar */
|
static const int topbar = 0; /* 0 means bottom bar */
|
||||||
static const char *fonts[] = { "Go:pixelsize=18:antialias=true:autohint=true", "FontAwesome:pixelsize=18:antialias=true:autohint=true"};
|
static const char *fonts[] = { "Go:pixelsize=16:antialias=true:autohint=true" };
|
||||||
static const char dmenufont[] = "Go:pixelsize=18:antialias=true:autohint=true";
|
static const char dmenufont[] = "Go:pixelsize=16:antialias=true:autohint=true";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
static const char col_gray2[] = "#444444";
|
static const char col_gray2[] = "#444444";
|
||||||
static const char col_gray3[] = "#bbbbbb";
|
static const char col_gray3[] = "#bbbbbb";
|
||||||
@ -26,7 +26,7 @@ static const char *colors[][3] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "1 com", "2 taler", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
@ -35,10 +35,8 @@ static const Rule rules[] = {
|
|||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||||
{ "Alacritty", NULL, "pamix", 0, 1, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
{ "Alacritty", NULL, "ncmpcpp", 0, 1, -1 },
|
{ "Google-chrome", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
// { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
// { "Google-chrome", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@ -66,14 +64,6 @@ static const Layout layouts[] = {
|
|||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||||
#define STACKKEYS(MOD,ACTION) \
|
|
||||||
{ MOD, XK_j, ACTION##stack, {.i = INC(+1) } }, \
|
|
||||||
{ MOD, XK_k, ACTION##stack, {.i = INC(-1) } }, \
|
|
||||||
{ MOD, XK_grave, ACTION##stack, {.i = PREVSEL } }, \
|
|
||||||
{ MOD, XK_q, ACTION##stack, {.i = 0 } }, \
|
|
||||||
{ MOD, XK_a, ACTION##stack, {.i = 1 } }, \
|
|
||||||
{ MOD, XK_z, ACTION##stack, {.i = 2 } }, \
|
|
||||||
{ MOD, XK_x, ACTION##stack, {.i = -1 } },
|
|
||||||
|
|
||||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
@ -82,8 +72,8 @@ static const Layout layouts[] = {
|
|||||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||||
static const char *termcmd[] = { "alacritty", NULL };
|
static const char *termcmd[] = { "alacritty", NULL };
|
||||||
static const char *brightup[] = { "sudo", "brightnessctl", "set", "+10%", NULL};
|
static const char *brightnessup[] = { "sudo", "brightnessctl", "set", "+10%", NULL};
|
||||||
static const char *brightdown[] = { "sudo", "brightnessctl", "set", "10%-", NULL};
|
static const char *brightnessdown[] = { "sudo", "brightnessctl", "set", "10%-", NULL};
|
||||||
static const char *audioup[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
|
static const char *audioup[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
|
||||||
static const char *audiodown[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
|
static const char *audiodown[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
|
||||||
static const char *audiotoggle[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
|
static const char *audiotoggle[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
|
||||||
@ -100,8 +90,8 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
{ MODKEY, XK_b, togglebar, {0} },
|
||||||
STACKKEYS(MODKEY, focus)
|
{ MODKEY, XK_j, focusstack, {.i = -1 } },
|
||||||
STACKKEYS(MODKEY|ShiftMask, push)
|
{ MODKEY, XK_k, focusstack, {.i = +1 } },
|
||||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
@ -137,10 +127,10 @@ static Key keys[] = {
|
|||||||
TAGKEYS( XK_7, 6)
|
TAGKEYS( XK_7, 6)
|
||||||
TAGKEYS( XK_8, 7)
|
TAGKEYS( XK_8, 7)
|
||||||
TAGKEYS( XK_9, 8)
|
TAGKEYS( XK_9, 8)
|
||||||
{ MODKEY|ShiftMask, XK_BackSpace, quit, {0} },
|
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
/* see <X11/XF86keysym.h> */
|
/* see <X11/XF86keysym.h> */
|
||||||
{ 0, 0x1008FF02,spawn, {.v = brightup} },
|
{ 0, 0x1008FF02,spawn, {.v = brightnessup} },
|
||||||
{ 0, 0x1008FF03,spawn, {.v = brightdown} },
|
{ 0, 0x1008FF03,spawn, {.v = brightnessdown} },
|
||||||
{ 0, 0x1008FF11,spawn, {.v = audiodown} },
|
{ 0, 0x1008FF11,spawn, {.v = audiodown} },
|
||||||
{ 0, 0x1008FF12,spawn, {.v = audiotoggle} },
|
{ 0, 0x1008FF12,spawn, {.v = audiotoggle} },
|
||||||
{ ShiftMask, 0x1008FF12,spawn, {.v = pamix} },
|
{ ShiftMask, 0x1008FF12,spawn, {.v = pamix} },
|
||||||
|
34
config.h
34
config.h
@ -11,8 +11,8 @@ static const int systraypinningfailfirst = 1; /* 1: if pinning fails, display
|
|||||||
static const int showsystray = 1; /* 0 means no systray */
|
static const int showsystray = 1; /* 0 means no systray */
|
||||||
static const int showbar = 1; /* 0 means no bar */
|
static const int showbar = 1; /* 0 means no bar */
|
||||||
static const int topbar = 0; /* 0 means bottom bar */
|
static const int topbar = 0; /* 0 means bottom bar */
|
||||||
static const char *fonts[] = { "Go:pixelsize=18:antialias=true:autohint=true", "FontAwesome:pixelsize=18:antialias=true:autohint=true"};
|
static const char *fonts[] = { "Go:pixelsize=16:antialias=true:autohint=true" };
|
||||||
static const char dmenufont[] = "Go:pixelsize=18:antialias=true:autohint=true";
|
static const char dmenufont[] = "Go:pixelsize=16:antialias=true:autohint=true";
|
||||||
static const char col_gray1[] = "#222222";
|
static const char col_gray1[] = "#222222";
|
||||||
static const char col_gray2[] = "#444444";
|
static const char col_gray2[] = "#444444";
|
||||||
static const char col_gray3[] = "#bbbbbb";
|
static const char col_gray3[] = "#bbbbbb";
|
||||||
@ -26,7 +26,7 @@ static const char *colors[][3] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
|
static const char *tags[] = { "1 com", "2 taler", "3", "4", "5", "6", "7", "8", "9" };
|
||||||
|
|
||||||
static const Rule rules[] = {
|
static const Rule rules[] = {
|
||||||
/* xprop(1):
|
/* xprop(1):
|
||||||
@ -35,10 +35,8 @@ static const Rule rules[] = {
|
|||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||||
{ "Alacritty", NULL, "pamix", 0, 1, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
{ "Alacritty", NULL, "ncmpcpp", 0, 1, -1 },
|
{ "Google-chrome", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
// { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
// { "Google-chrome", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* layout(s) */
|
/* layout(s) */
|
||||||
@ -66,14 +64,6 @@ static const Layout layouts[] = {
|
|||||||
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
{ MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
{ MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
|
||||||
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
{ MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
|
||||||
#define STACKKEYS(MOD,ACTION) \
|
|
||||||
{ MOD, XK_j, ACTION##stack, {.i = INC(+1) } }, \
|
|
||||||
{ MOD, XK_k, ACTION##stack, {.i = INC(-1) } }, \
|
|
||||||
{ MOD, XK_grave, ACTION##stack, {.i = PREVSEL } }, \
|
|
||||||
{ MOD, XK_q, ACTION##stack, {.i = 0 } }, \
|
|
||||||
{ MOD, XK_a, ACTION##stack, {.i = 1 } }, \
|
|
||||||
{ MOD, XK_z, ACTION##stack, {.i = 2 } }, \
|
|
||||||
{ MOD, XK_x, ACTION##stack, {.i = -1 } },
|
|
||||||
|
|
||||||
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
/* helper for spawning shell commands in the pre dwm-5.0 fashion */
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
@ -82,8 +72,8 @@ static const Layout layouts[] = {
|
|||||||
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
|
||||||
static const char *termcmd[] = { "alacritty", NULL };
|
static const char *termcmd[] = { "alacritty", NULL };
|
||||||
static const char *brightup[] = { "sudo", "brightnessctl", "set", "+10%", NULL};
|
static const char *brightnessup[] = { "sudo", "brightnessctl", "set", "+10%", NULL};
|
||||||
static const char *brightdown[] = { "sudo", "brightnessctl", "set", "10%-", NULL};
|
static const char *brightnessdown[] = { "sudo", "brightnessctl", "set", "10%-", NULL};
|
||||||
static const char *audioup[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
|
static const char *audioup[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "+5%", NULL };
|
||||||
static const char *audiodown[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
|
static const char *audiodown[] = { "pactl", "set-sink-volume", "@DEFAULT_SINK@", "-5%", NULL };
|
||||||
static const char *audiotoggle[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
|
static const char *audiotoggle[] = { "pactl", "set-sink-mute", "@DEFAULT_SINK@", "toggle", NULL };
|
||||||
@ -100,8 +90,8 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
{ MODKEY, XK_p, spawn, {.v = dmenucmd } },
|
||||||
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
{ MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
|
||||||
{ MODKEY, XK_b, togglebar, {0} },
|
{ MODKEY, XK_b, togglebar, {0} },
|
||||||
STACKKEYS(MODKEY, focus)
|
{ MODKEY, XK_j, focusstack, {.i = -1 } },
|
||||||
STACKKEYS(MODKEY|ShiftMask, push)
|
{ MODKEY, XK_k, focusstack, {.i = +1 } },
|
||||||
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
{ MODKEY, XK_i, incnmaster, {.i = +1 } },
|
||||||
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
{ MODKEY, XK_d, incnmaster, {.i = -1 } },
|
||||||
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
{ MODKEY, XK_h, setmfact, {.f = -0.05} },
|
||||||
@ -137,10 +127,10 @@ static Key keys[] = {
|
|||||||
TAGKEYS( XK_7, 6)
|
TAGKEYS( XK_7, 6)
|
||||||
TAGKEYS( XK_8, 7)
|
TAGKEYS( XK_8, 7)
|
||||||
TAGKEYS( XK_9, 8)
|
TAGKEYS( XK_9, 8)
|
||||||
{ MODKEY|ShiftMask, XK_BackSpace, quit, {0} },
|
{ MODKEY|ShiftMask, XK_q, quit, {0} },
|
||||||
/* see <X11/XF86keysym.h> */
|
/* see <X11/XF86keysym.h> */
|
||||||
{ 0, 0x1008FF02,spawn, {.v = brightup} },
|
{ 0, 0x1008FF02,spawn, {.v = brightnessup} },
|
||||||
{ 0, 0x1008FF03,spawn, {.v = brightdown} },
|
{ 0, 0x1008FF03,spawn, {.v = brightnessdown} },
|
||||||
{ 0, 0x1008FF11,spawn, {.v = audiodown} },
|
{ 0, 0x1008FF11,spawn, {.v = audiodown} },
|
||||||
{ 0, 0x1008FF12,spawn, {.v = audiotoggle} },
|
{ 0, 0x1008FF12,spawn, {.v = audiotoggle} },
|
||||||
{ ShiftMask, 0x1008FF12,spawn, {.v = pamix} },
|
{ ShiftMask, 0x1008FF12,spawn, {.v = pamix} },
|
||||||
|
85
dwm.c
85
dwm.c
@ -47,21 +47,15 @@
|
|||||||
/* macros */
|
/* macros */
|
||||||
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
||||||
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask) & (ShiftMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask))
|
||||||
#define GETINC(X) ((X) - 2000)
|
|
||||||
#define INC(X) ((X) + 2000)
|
|
||||||
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
|
#define INTERSECT(x,y,w,h,m) (MAX(0, MIN((x)+(w),(m)->wx+(m)->ww) - MAX((x),(m)->wx)) \
|
||||||
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
|
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
|
||||||
#define ISINC(X) ((X) > 1000 && (X) < 3000)
|
|
||||||
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
|
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
|
||||||
#define PREVSEL 3000
|
|
||||||
#define LENGTH(X) (sizeof X / sizeof X[0])
|
#define LENGTH(X) (sizeof X / sizeof X[0])
|
||||||
#define MOD(N,M) ((N)%(M) < 0 ? (N)%(M) + (M) : (N)%(M))
|
|
||||||
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
||||||
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
|
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
|
||||||
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
|
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
|
||||||
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
||||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||||
#define TRUNC(X,A,B) (MAX((A), MIN((X), (B))))
|
|
||||||
|
|
||||||
#define SYSTEM_TRAY_REQUEST_DOCK 0
|
#define SYSTEM_TRAY_REQUEST_DOCK 0
|
||||||
/* XEMBED messages */
|
/* XEMBED messages */
|
||||||
@ -216,7 +210,6 @@ static void movemouse(const Arg *arg);
|
|||||||
static Client *nexttiled(Client *c);
|
static Client *nexttiled(Client *c);
|
||||||
static void pop(Client *);
|
static void pop(Client *);
|
||||||
static void propertynotify(XEvent *e);
|
static void propertynotify(XEvent *e);
|
||||||
static void pushstack(const Arg *arg);
|
|
||||||
static void quit(const Arg *arg);
|
static void quit(const Arg *arg);
|
||||||
static Monitor *recttomon(int x, int y, int w, int h);
|
static Monitor *recttomon(int x, int y, int w, int h);
|
||||||
static void removesystrayicon(Client *i);
|
static void removesystrayicon(Client *i);
|
||||||
@ -241,7 +234,6 @@ static void seturgent(Client *c, int urg);
|
|||||||
static void showhide(Client *c);
|
static void showhide(Client *c);
|
||||||
static void sigchld(int unused);
|
static void sigchld(int unused);
|
||||||
static void spawn(const Arg *arg);
|
static void spawn(const Arg *arg);
|
||||||
static int stackpos(const Arg *arg);
|
|
||||||
static Monitor *systraytomon(Monitor *m);
|
static Monitor *systraytomon(Monitor *m);
|
||||||
static void tag(const Arg *arg);
|
static void tag(const Arg *arg);
|
||||||
static void tagmon(const Arg *arg);
|
static void tagmon(const Arg *arg);
|
||||||
@ -949,15 +941,27 @@ focusmon(const Arg *arg)
|
|||||||
void
|
void
|
||||||
focusstack(const Arg *arg)
|
focusstack(const Arg *arg)
|
||||||
{
|
{
|
||||||
int i = stackpos(arg);
|
Client *c = NULL, *i;
|
||||||
Client *c, *p;
|
|
||||||
|
|
||||||
if(i < 0)
|
if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
|
||||||
return;
|
return;
|
||||||
for(p = NULL, c = selmon->clients; c && (i || !ISVISIBLE(c));
|
if (arg->i > 0) {
|
||||||
i -= ISVISIBLE(c) ? 1 : 0, p = c, c = c->next);
|
for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
|
||||||
focus(c ? c : p);
|
if (!c)
|
||||||
|
for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
|
||||||
|
} else {
|
||||||
|
for (i = selmon->clients; i != selmon->sel; i = i->next)
|
||||||
|
if (ISVISIBLE(i))
|
||||||
|
c = i;
|
||||||
|
if (!c)
|
||||||
|
for (; i; i = i->next)
|
||||||
|
if (ISVISIBLE(i))
|
||||||
|
c = i;
|
||||||
|
}
|
||||||
|
if (c) {
|
||||||
|
focus(c);
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Atom
|
Atom
|
||||||
@ -1387,29 +1391,6 @@ propertynotify(XEvent *e)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
pushstack(const Arg *arg) {
|
|
||||||
int i = stackpos(arg);
|
|
||||||
Client *sel = selmon->sel, *c, *p;
|
|
||||||
|
|
||||||
if(i < 0)
|
|
||||||
return;
|
|
||||||
else if(i == 0) {
|
|
||||||
detach(sel);
|
|
||||||
attach(sel);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for(p = NULL, c = selmon->clients; c; p = c, c = c->next)
|
|
||||||
if(!(i -= (ISVISIBLE(c) && c != sel)))
|
|
||||||
break;
|
|
||||||
c = c ? c : p;
|
|
||||||
detach(sel);
|
|
||||||
sel->next = c->next;
|
|
||||||
c->next = sel;
|
|
||||||
}
|
|
||||||
arrange(selmon);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
quit(const Arg *arg)
|
quit(const Arg *arg)
|
||||||
{
|
{
|
||||||
@ -1881,36 +1862,6 @@ spawn(const Arg *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
stackpos(const Arg *arg) {
|
|
||||||
int n, i;
|
|
||||||
Client *c, *l;
|
|
||||||
|
|
||||||
if(!selmon->clients)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if(arg->i == PREVSEL) {
|
|
||||||
for(l = selmon->stack; l && (!ISVISIBLE(l) || l == selmon->sel); l = l->snext);
|
|
||||||
if(!l)
|
|
||||||
return -1;
|
|
||||||
for(i = 0, c = selmon->clients; c != l; i += ISVISIBLE(c) ? 1 : 0, c = c->next);
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
else if(ISINC(arg->i)) {
|
|
||||||
if(!selmon->sel)
|
|
||||||
return -1;
|
|
||||||
for(i = 0, c = selmon->clients; c != selmon->sel; i += ISVISIBLE(c) ? 1 : 0, c = c->next);
|
|
||||||
for(n = i; c; n += ISVISIBLE(c) ? 1 : 0, c = c->next);
|
|
||||||
return MOD(i + GETINC(arg->i), n);
|
|
||||||
}
|
|
||||||
else if(arg->i < 0) {
|
|
||||||
for(i = 0, c = selmon->clients; c; i += ISVISIBLE(c) ? 1 : 0, c = c->next);
|
|
||||||
return MAX(i + arg->i, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return arg->i;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tag(const Arg *arg)
|
tag(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user