Compare commits
No commits in common. "439d2a96c27935533d6e7a6f8eed8bbcb4e70144" and "264d8f9d821cd49135617a412549b23c0ac3abea" have entirely different histories.
439d2a96c2
...
264d8f9d82
33
config.def.h
33
config.def.h
|
@ -34,7 +34,7 @@ static char *colors[][3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "", "", "", "", "5", "6", "", "", "" };
|
static const char *tags[] = { "", "", "3", "", "5", "6", "7", "8", "" };
|
||||||
|
|
||||||
/* launcher commands (They must be NULL terminated) */
|
/* launcher commands (They must be NULL terminated) */
|
||||||
static const char* grabc[] = { "grabc", "|", "tr", "-d", "'\n'", "|", "xclip", "-selection", "clipboard", NULL };
|
static const char* grabc[] = { "grabc", "|", "tr", "-d", "'\n'", "|", "xclip", "-selection", "clipboard", NULL };
|
||||||
|
@ -54,27 +54,8 @@ static const Rule rules[] = {
|
||||||
* WM_NAME(STRING) = title
|
* WM_NAME(STRING) = title
|
||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
// ----- 1 -----
|
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||||
{ "st-256color", NULL, NULL, 0, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
// ----- 2 -----
|
|
||||||
{ "Code", NULL, NULL, 1 << 1, 0, -1 },
|
|
||||||
// ----- 3 -----
|
|
||||||
{ "thunderbird", NULL, NULL, 1 << 2, 0, -1 },
|
|
||||||
{ "KeePassXC", NULL, NULL, 1 << 2, 0, -1 },
|
|
||||||
// ----- 4 -----
|
|
||||||
{ "TelegramDesktop", NULL, NULL, 1 << 3, 0, -1 },
|
|
||||||
{ "discord", NULL, NULL, 1 << 3, 0, -1 },
|
|
||||||
// ----- 5 -----
|
|
||||||
{ "Steam", NULL, NULL, 1 << 4, 0, -1 },
|
|
||||||
{ "steamwebhelper", NULL, NULL, 1 << 4, 0, -1 },
|
|
||||||
// ----- 7 -----
|
|
||||||
{ "QjackCtl", NULL, NULL, 1 << 6, 1, -1 },
|
|
||||||
{ "PatchMatrix", NULL, NULL, 1 << 6, 0, -1 },
|
|
||||||
{ "Blueman-manager", NULL, NULL, 1 << 6, 0, -1 },
|
|
||||||
{ "corectrl", NULL, NULL, 1 << 6, 0, -1 },
|
|
||||||
// ----- 9 -----
|
|
||||||
{ "firefox", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
// ----- OTHER -----
|
|
||||||
{ "xwinwrap", NULL, NULL, 1 << 9, 0, -1 },
|
{ "xwinwrap", NULL, NULL, 1 << 9, 0, -1 },
|
||||||
{ NULL, NULL, "broken", 1 << 9, 0, -1 },
|
{ NULL, NULL, "broken", 1 << 9, 0, -1 },
|
||||||
};
|
};
|
||||||
|
@ -117,14 +98,12 @@ static const char *voldown[] = { "pactl", "set-sink-volume", "0", "-5%", NULL };
|
||||||
static const char *volmute[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
|
static const char *volmute[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
|
||||||
|
|
||||||
static const char *backlightup[] = { "s", "set-sink-mute", "0", "toggle", NULL };
|
static const char *backlightup[] = { "s", "set-sink-mute", "0", "toggle", NULL };
|
||||||
static const char *lockcmd[] = { "slock", NULL };
|
|
||||||
|
|
||||||
static const char *dmenucmd[] = { "dmenu_run", "-g", "15", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
|
static const char *dmenucmd[] = { "dmenu_run", "-g", "15", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
|
||||||
static const char *termcmd[] = { "st", NULL };
|
static const char *termcmd[] = { "st", NULL };
|
||||||
|
|
||||||
static const Key keys[] = {
|
static const Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ 0, XF86XK_ModeLock, spawn, {.v = lockcmd } },
|
|
||||||
{ 0, XK_Print, spawn, {.v = screenshot } },
|
{ 0, XK_Print, spawn, {.v = screenshot } },
|
||||||
{ ShiftMask, XK_Print, spawn, {.v = screenshotarea } },
|
{ ShiftMask, XK_Print, spawn, {.v = screenshotarea } },
|
||||||
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } },
|
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } },
|
||||||
|
@ -183,9 +162,9 @@ static const Button buttons[] = {
|
||||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||||
{ ClkClientWin, ALTKEY, Button1, movemouse, {0} },
|
{ ClkClientWin, SUPERKEY, Button1, movemouse, {0} },
|
||||||
{ ClkClientWin, ALTKEY, Button2, togglefloating, {0} },
|
{ ClkClientWin, SUPERKEY, Button2, togglefloating, {0} },
|
||||||
{ ClkClientWin, ALTKEY, Button3, resizemouse, {0} },
|
{ ClkClientWin, SUPERKEY, Button3, resizemouse, {0} },
|
||||||
{ ClkTagBar, 0, Button1, view, {0} },
|
{ ClkTagBar, 0, Button1, view, {0} },
|
||||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||||
{ ClkTagBar, SUPERKEY, Button1, tag, {0} },
|
{ ClkTagBar, SUPERKEY, Button1, tag, {0} },
|
||||||
|
|
41
config.h
41
config.h
|
@ -34,7 +34,7 @@ static char *colors[][3] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* tagging */
|
/* tagging */
|
||||||
static const char *tags[] = { "", "", "", "", "5", "6", "", "", "" };
|
static const char *tags[] = { "", "", "3", "", "5", "6", "7", "8", "" };
|
||||||
|
|
||||||
/* launcher commands (They must be NULL terminated) */
|
/* launcher commands (They must be NULL terminated) */
|
||||||
static const char* grabc[] = { "grabc", "|", "tr", "-d", "'\n'", "|", "xclip", "-selection", "clipboard", NULL };
|
static const char* grabc[] = { "grabc", "|", "tr", "-d", "'\n'", "|", "xclip", "-selection", "clipboard", NULL };
|
||||||
|
@ -54,27 +54,8 @@ static const Rule rules[] = {
|
||||||
* WM_NAME(STRING) = title
|
* WM_NAME(STRING) = title
|
||||||
*/
|
*/
|
||||||
/* class instance title tags mask isfloating monitor */
|
/* class instance title tags mask isfloating monitor */
|
||||||
// ----- 1 -----
|
{ "Gimp", NULL, NULL, 0, 1, -1 },
|
||||||
{ "st-256color", NULL, NULL, 0, 0, -1 },
|
{ "Firefox", NULL, NULL, 1 << 8, 0, -1 },
|
||||||
// ----- 2 -----
|
|
||||||
{ "Code", NULL, NULL, 1 << 1, 0, -1 },
|
|
||||||
// ----- 3 -----
|
|
||||||
{ "thunderbird", NULL, NULL, 1 << 2, 0, -1 },
|
|
||||||
{ "KeePassXC", NULL, NULL, 1 << 2, 0, -1 },
|
|
||||||
// ----- 4 -----
|
|
||||||
{ "TelegramDesktop", NULL, NULL, 1 << 3, 0, -1 },
|
|
||||||
{ "discord", NULL, NULL, 1 << 3, 0, -1 },
|
|
||||||
// ----- 5 -----
|
|
||||||
{ "Steam", NULL, NULL, 1 << 4, 0, -1 },
|
|
||||||
{ "steamwebhelper", NULL, NULL, 1 << 4, 0, -1 },
|
|
||||||
// ----- 7 -----
|
|
||||||
{ "QjackCtl", NULL, NULL, 1 << 6, 1, -1 },
|
|
||||||
{ "PatchMatrix", NULL, NULL, 1 << 6, 0, -1 },
|
|
||||||
{ "Blueman-manager", NULL, NULL, 1 << 6, 0, -1 },
|
|
||||||
{ "corectrl", NULL, NULL, 1 << 6, 0, -1 },
|
|
||||||
// ----- 9 -----
|
|
||||||
{ "firefox", NULL, NULL, 1 << 8, 0, -1 },
|
|
||||||
// ----- OTHER -----
|
|
||||||
{ "xwinwrap", NULL, NULL, 1 << 9, 0, -1 },
|
{ "xwinwrap", NULL, NULL, 1 << 9, 0, -1 },
|
||||||
{ NULL, NULL, "broken", 1 << 9, 0, -1 },
|
{ NULL, NULL, "broken", 1 << 9, 0, -1 },
|
||||||
};
|
};
|
||||||
|
@ -109,6 +90,8 @@ static const Layout layouts[] = {
|
||||||
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
|
||||||
|
|
||||||
/* commands */
|
/* commands */
|
||||||
|
static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
|
||||||
|
|
||||||
static const char *screenshot[] = { "scrsht", NULL };
|
static const char *screenshot[] = { "scrsht", NULL };
|
||||||
static const char *screenshotarea[] = { "scrsht", "-s", NULL };
|
static const char *screenshotarea[] = { "scrsht", "-s", NULL };
|
||||||
|
|
||||||
|
@ -117,14 +100,12 @@ static const char *voldown[] = { "pactl", "set-sink-volume", "0", "-5%", NULL };
|
||||||
static const char *volmute[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
|
static const char *volmute[] = { "pactl", "set-sink-mute", "0", "toggle", NULL };
|
||||||
|
|
||||||
static const char *backlightup[] = { "s", "set-sink-mute", "0", "toggle", NULL };
|
static const char *backlightup[] = { "s", "set-sink-mute", "0", "toggle", NULL };
|
||||||
static const char *lockcmd[] = { "slock", NULL };
|
|
||||||
|
|
||||||
static const char *dmenucmd[] = { "dmenu_run", "-g", "15", "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
|
static const char *dmenucmd[] = { "dmenu_run", "-g", "15", "-m", dmenumon, "-fn", dmenufont, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbordercolor, "-sf", selfgcolor, NULL };
|
||||||
static const char *termcmd[] = { "st", NULL };
|
static const char *termcmd[] = { "st", NULL };
|
||||||
|
|
||||||
static const Key keys[] = {
|
static Key keys[] = {
|
||||||
/* modifier key function argument */
|
/* modifier key function argument */
|
||||||
{ 0, XF86XK_ModeLock, spawn, {.v = lockcmd } },
|
|
||||||
{ 0, XK_Print, spawn, {.v = screenshot } },
|
{ 0, XK_Print, spawn, {.v = screenshot } },
|
||||||
{ ShiftMask, XK_Print, spawn, {.v = screenshotarea } },
|
{ ShiftMask, XK_Print, spawn, {.v = screenshotarea } },
|
||||||
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } },
|
{ 0, XF86XK_AudioRaiseVolume, spawn, {.v = volup } },
|
||||||
|
@ -178,14 +159,14 @@ static const Key keys[] = {
|
||||||
|
|
||||||
/* button definitions */
|
/* button definitions */
|
||||||
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
/* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
|
||||||
static const Button buttons[] = {
|
static Button buttons[] = {
|
||||||
/* click event mask button function argument */
|
/* click event mask button function argument */
|
||||||
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
{ ClkLtSymbol, 0, Button1, setlayout, {0} },
|
||||||
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
{ ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
|
||||||
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
{ ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
|
||||||
{ ClkClientWin, ALTKEY, Button1, movemouse, {0} },
|
{ ClkClientWin, SUPERKEY, Button1, movemouse, {0} },
|
||||||
{ ClkClientWin, ALTKEY, Button2, togglefloating, {0} },
|
{ ClkClientWin, SUPERKEY, Button2, togglefloating, {0} },
|
||||||
{ ClkClientWin, ALTKEY, Button3, resizemouse, {0} },
|
{ ClkClientWin, SUPERKEY, Button3, resizemouse, {0} },
|
||||||
{ ClkTagBar, 0, Button1, view, {0} },
|
{ ClkTagBar, 0, Button1, view, {0} },
|
||||||
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
{ ClkTagBar, 0, Button3, toggleview, {0} },
|
||||||
{ ClkTagBar, SUPERKEY, Button1, tag, {0} },
|
{ ClkTagBar, SUPERKEY, Button1, tag, {0} },
|
||||||
|
|
40
dwm.c
40
dwm.c
|
@ -482,7 +482,7 @@ buttonpress(XEvent *e)
|
||||||
goto execute_handler;
|
goto execute_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
x += TEXTW(selmon->ltsymbol);
|
x += blw;
|
||||||
|
|
||||||
for(i = 0; i < LENGTH(launchers); i++) {
|
for(i = 0; i < LENGTH(launchers); i++) {
|
||||||
x += TEXTW(launchers[i].name);
|
x += TEXTW(launchers[i].name);
|
||||||
|
@ -837,8 +837,8 @@ drawstatusbar(Monitor *m, int bh, int extra, char* stext) {
|
||||||
|
|
||||||
if (extra) {
|
if (extra) {
|
||||||
w = m->ww;
|
w = m->ww;
|
||||||
w = m->ww - w - 2 * hpb;
|
// w = m->ww - w - 2 * hpb;
|
||||||
ret = m->ww - w;
|
ret = 1;
|
||||||
x = 0 - 1;
|
x = 0 - 1;
|
||||||
x2 = m->ww - w2 - 2 * hpb;
|
x2 = m->ww - w2 - 2 * hpb;
|
||||||
} else {
|
} else {
|
||||||
|
@ -980,6 +980,8 @@ void
|
||||||
drawbar(Monitor *m)
|
drawbar(Monitor *m)
|
||||||
{
|
{
|
||||||
int x, w, tw = 0;
|
int x, w, tw = 0;
|
||||||
|
int boxs = drw->fonts->h / 9;
|
||||||
|
int boxw = drw->fonts->h / 6 + 2;
|
||||||
unsigned int i, occ = 0, urg = 0;
|
unsigned int i, occ = 0, urg = 0;
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
|
@ -1635,14 +1637,9 @@ void
|
||||||
resizemouse(const Arg *arg)
|
resizemouse(const Arg *arg)
|
||||||
{
|
{
|
||||||
int ocx, ocy, nw, nh;
|
int ocx, ocy, nw, nh;
|
||||||
int ocx2, ocy2, nx, ny;
|
|
||||||
Client *c;
|
Client *c;
|
||||||
Monitor *m;
|
Monitor *m;
|
||||||
XEvent ev;
|
XEvent ev;
|
||||||
int horizcorner, vertcorner;
|
|
||||||
int di;
|
|
||||||
unsigned int dui;
|
|
||||||
Window dummy;
|
|
||||||
Time lasttime = 0;
|
Time lasttime = 0;
|
||||||
|
|
||||||
if (!(c = selmon->sel))
|
if (!(c = selmon->sel))
|
||||||
|
@ -1652,19 +1649,10 @@ resizemouse(const Arg *arg)
|
||||||
restack(selmon);
|
restack(selmon);
|
||||||
ocx = c->x;
|
ocx = c->x;
|
||||||
ocy = c->y;
|
ocy = c->y;
|
||||||
ocx2 = c->x + c->w;
|
|
||||||
ocy2 = c->y + c->h;
|
|
||||||
if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync,
|
||||||
None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess)
|
None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess)
|
||||||
return;
|
return;
|
||||||
// XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
|
||||||
if (!XQueryPointer (dpy, c->win, &dummy, &dummy, &di, &di, &nx, &ny, &dui))
|
|
||||||
return;
|
|
||||||
horizcorner = nx < c->w / 2;
|
|
||||||
vertcorner = ny < c->h / 2;
|
|
||||||
XWarpPointer (dpy, None, c->win, 0, 0, 0, 0,
|
|
||||||
horizcorner ? (-c->bw) : (c->w + c->bw -1),
|
|
||||||
vertcorner ? (-c->bw) : (c->h + c->bw -1));
|
|
||||||
do {
|
do {
|
||||||
XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
|
XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev);
|
||||||
switch(ev.type) {
|
switch(ev.type) {
|
||||||
|
@ -1678,12 +1666,8 @@ resizemouse(const Arg *arg)
|
||||||
continue;
|
continue;
|
||||||
lasttime = ev.xmotion.time;
|
lasttime = ev.xmotion.time;
|
||||||
|
|
||||||
// nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
|
nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1);
|
||||||
// nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
|
nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1);
|
||||||
nx = horizcorner ? ev.xmotion.x : c->x;
|
|
||||||
ny = vertcorner ? ev.xmotion.y : c->y;
|
|
||||||
nw = MAX(horizcorner ? (ocx2 - nx) : (ev.xmotion.x - ocx - 2 * c->bw + 1), 1);
|
|
||||||
nh = MAX(vertcorner ? (ocy2 - ny) : (ev.xmotion.y - ocy - 2 * c->bw + 1), 1);
|
|
||||||
|
|
||||||
if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww
|
if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww
|
||||||
&& c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh)
|
&& c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh)
|
||||||
|
@ -1693,15 +1677,11 @@ resizemouse(const Arg *arg)
|
||||||
togglefloating(NULL);
|
togglefloating(NULL);
|
||||||
}
|
}
|
||||||
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
|
if (!selmon->lt[selmon->sellt]->arrange || c->isfloating)
|
||||||
// resize(c, c->x, c->y, nw, nh, 1);
|
resize(c, c->x, c->y, nw, nh, 1);
|
||||||
resize(c, nx, ny, nw, nh, 1);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (ev.type != ButtonRelease);
|
} while (ev.type != ButtonRelease);
|
||||||
// XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
|
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1);
|
||||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0,
|
|
||||||
horizcorner ? (-c->bw) : (c->w + c->bw - 1),
|
|
||||||
vertcorner ? (-c->bw) : (c->h + c->bw - 1));
|
|
||||||
XUngrabPointer(dpy, CurrentTime);
|
XUngrabPointer(dpy, CurrentTime);
|
||||||
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
while (XCheckMaskEvent(dpy, EnterWindowMask, &ev));
|
||||||
if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
|
if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
|
||||||
|
|
Loading…
Reference in New Issue