mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
Adding leftlayout patch
This commit is contained in:
parent
009819e186
commit
1cff033127
@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
|
|
||||||
### Changelog:
|
### Changelog:
|
||||||
|
|
||||||
|
2019-10-01 - Added leftlayout patch
|
||||||
|
|
||||||
2019-09-30 - Replaced flextile with flextile-deluxe, refactored monitor rules to support predetermined layouts per tag
|
2019-09-30 - Replaced flextile with flextile-deluxe, refactored monitor rules to support predetermined layouts per tag
|
||||||
|
|
||||||
2019-09-15 - Added focusonclick, xrdb, viewontag, urgentborder and winview patches
|
2019-09-15 - Added focusonclick, xrdb, viewontag, urgentborder and winview patches
|
||||||
@ -100,6 +102,9 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
|
|||||||
- by default, dwm responds to \_NET_ACTIVE_WINDOW client messages by setting the urgency bit on the named window
|
- by default, dwm responds to \_NET_ACTIVE_WINDOW client messages by setting the urgency bit on the named window
|
||||||
- this patch activates the window instead
|
- this patch activates the window instead
|
||||||
|
|
||||||
|
- [leftlayout](http://dwm.suckless.org/patches/leftlayout/)
|
||||||
|
- moves the layout symbol in the status bar to the left hand side
|
||||||
|
|
||||||
- [losefullscreen](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-losefullscreen-6.2.diff)
|
- [losefullscreen](https://github.com/bakkeby/dwm-vanitygaps/blob/master/patches/dwm-losefullscreen-6.2.diff)
|
||||||
- by default in dwm it is possible to make an application fullscreen, then use the focusstack keybindings to focus on other windows beneath the current window
|
- by default in dwm it is possible to make an application fullscreen, then use the focusstack keybindings to focus on other windows beneath the current window
|
||||||
- it is also possible to spawn new windows (e.g. a terminal) that end up getting focus while the previous window remains in fullscreen
|
- it is also possible to spawn new windows (e.g. a terminal) that end up getting focus while the previous window remains in fullscreen
|
||||||
|
60
dwm.c
60
dwm.c
@ -610,14 +610,18 @@ buttonpress(XEvent *e)
|
|||||||
}
|
}
|
||||||
if (ev->window == selmon->barwin) {
|
if (ev->window == selmon->barwin) {
|
||||||
i = x = 0;
|
i = x = 0;
|
||||||
|
#if LEFTLAYOUT_PATCH
|
||||||
|
x += blw;
|
||||||
|
if (ev->x < x) {
|
||||||
|
click = ClkLtSymbol;
|
||||||
|
} else {
|
||||||
do
|
do
|
||||||
x += TEXTW(tags[i]);
|
x += TEXTW(tags[i]);
|
||||||
while (ev->x >= x && ++i < LENGTH(tags));
|
while (ev->x >= x && ++i < LENGTH(tags));
|
||||||
if (i < LENGTH(tags)) {
|
if (i < LENGTH(tags)) {
|
||||||
click = ClkTagBar;
|
click = ClkTagBar;
|
||||||
arg.ui = 1 << i;
|
arg.ui = 1 << i;
|
||||||
} else if (ev->x < x + blw)
|
}
|
||||||
click = ClkLtSymbol;
|
|
||||||
#if AWESOMEBAR_PATCH && SYSTRAY_PATCH
|
#if AWESOMEBAR_PATCH && SYSTRAY_PATCH
|
||||||
else if (ev->x > selmon->ww - TEXTW(stext) + lrpad - 2 - getsystraywidth())
|
else if (ev->x > selmon->ww - TEXTW(stext) + lrpad - 2 - getsystraywidth())
|
||||||
#elif AWESOMEBAR_PATCH
|
#elif AWESOMEBAR_PATCH
|
||||||
@ -626,9 +630,8 @@ buttonpress(XEvent *e)
|
|||||||
else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
|
else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
|
||||||
#else
|
#else
|
||||||
else if (ev->x > selmon->ww - TEXTW(stext))
|
else if (ev->x > selmon->ww - TEXTW(stext))
|
||||||
#endif // SYSTRAY_PATCH
|
#endif // SYSTRAY_PATCH / AWESOMEBAR_PATCH
|
||||||
click = ClkStatusText;
|
click = ClkStatusText;
|
||||||
|
|
||||||
#if AWESOMEBAR_PATCH
|
#if AWESOMEBAR_PATCH
|
||||||
else {
|
else {
|
||||||
x += blw;
|
x += blw;
|
||||||
@ -650,6 +653,48 @@ buttonpress(XEvent *e)
|
|||||||
else
|
else
|
||||||
click = ClkWinTitle;
|
click = ClkWinTitle;
|
||||||
#endif // AWESOMEBAR_PATCH
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
}
|
||||||
|
#else // LEFTLAYOUT_PATCH
|
||||||
|
do
|
||||||
|
x += TEXTW(tags[i]);
|
||||||
|
while (ev->x >= x && ++i < LENGTH(tags));
|
||||||
|
if (i < LENGTH(tags)) {
|
||||||
|
click = ClkTagBar;
|
||||||
|
arg.ui = 1 << i;
|
||||||
|
} else if (ev->x < x + blw)
|
||||||
|
click = ClkLtSymbol;
|
||||||
|
#if AWESOMEBAR_PATCH && SYSTRAY_PATCH
|
||||||
|
else if (ev->x > selmon->ww - TEXTW(stext) + lrpad - 2 - getsystraywidth())
|
||||||
|
#elif AWESOMEBAR_PATCH
|
||||||
|
else if (ev->x > selmon->ww - TEXTW(stext) + lrpad - 2)
|
||||||
|
#elif SYSTRAY_PATCH
|
||||||
|
else if (ev->x > selmon->ww - TEXTW(stext) - getsystraywidth())
|
||||||
|
#else
|
||||||
|
else if (ev->x > selmon->ww - TEXTW(stext))
|
||||||
|
#endif // SYSTRAY_PATCH / AWESOMEBAR_PATCH
|
||||||
|
click = ClkStatusText;
|
||||||
|
#if AWESOMEBAR_PATCH
|
||||||
|
else {
|
||||||
|
x += blw;
|
||||||
|
c = m->clients;
|
||||||
|
|
||||||
|
do {
|
||||||
|
if (!ISVISIBLE(c))
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
x += (1.0 / (double)m->bt) * m->btw;
|
||||||
|
} while (ev->x > x && (c = c->next));
|
||||||
|
|
||||||
|
if (c) {
|
||||||
|
click = ClkWinTitle;
|
||||||
|
arg.v = c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
else
|
||||||
|
click = ClkWinTitle;
|
||||||
|
#endif // AWESOMEBAR_PATCH
|
||||||
|
#endif // LEFTLAYOUT_PATCH
|
||||||
} else if ((c = wintoclient(ev->window))) {
|
} else if ((c = wintoclient(ev->window))) {
|
||||||
#if FOCUSONCLICK_PATCH
|
#if FOCUSONCLICK_PATCH
|
||||||
if (focusonwheel || (ev->button != Button4 && ev->button != Button5))
|
if (focusonwheel || (ev->button != Button4 && ev->button != Button5))
|
||||||
@ -1146,6 +1191,11 @@ drawbar(Monitor *m)
|
|||||||
urg |= c->tags;
|
urg |= c->tags;
|
||||||
}
|
}
|
||||||
x = 0;
|
x = 0;
|
||||||
|
#if LEFTLAYOUT_PATCH
|
||||||
|
w = blw = TEXTW(m->ltsymbol);
|
||||||
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
|
#endif // LEFTLAYOUT_PATCH
|
||||||
for (i = 0; i < LENGTH(tags); i++) {
|
for (i = 0; i < LENGTH(tags); i++) {
|
||||||
w = TEXTW(tags[i]);
|
w = TEXTW(tags[i]);
|
||||||
#if ALTERNATIVE_TAGS_PATCH
|
#if ALTERNATIVE_TAGS_PATCH
|
||||||
@ -1169,9 +1219,11 @@ drawbar(Monitor *m)
|
|||||||
#endif // ACTIVETAGINDICATORBAR_PATCH
|
#endif // ACTIVETAGINDICATORBAR_PATCH
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
|
#if !LEFTLAYOUT_PATCH
|
||||||
w = blw = TEXTW(m->ltsymbol);
|
w = blw = TEXTW(m->ltsymbol);
|
||||||
drw_setscheme(drw, scheme[SchemeNorm]);
|
drw_setscheme(drw, scheme[SchemeNorm]);
|
||||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
|
||||||
|
#endif // LEFTLAYOUT_PATCH
|
||||||
|
|
||||||
#if SYSTRAY_PATCH
|
#if SYSTRAY_PATCH
|
||||||
if ((w = m->ww - sw - stw - x) > bh)
|
if ((w = m->ww - sw - stw - x) > bh)
|
||||||
|
@ -141,6 +141,11 @@
|
|||||||
*/
|
*/
|
||||||
#define FOCUSONNETACTIVE_PATCH 0
|
#define FOCUSONNETACTIVE_PATCH 0
|
||||||
|
|
||||||
|
/* Moves the layout symbol in the status bar to the left hand side.
|
||||||
|
* http://dwm.suckless.org/patches/leftlayout/
|
||||||
|
*/
|
||||||
|
#define LEFTLAYOUT_PATCH 0
|
||||||
|
|
||||||
/* By default in dwm it is possible to make an application fullscreen, then use
|
/* By default in dwm it is possible to make an application fullscreen, then use
|
||||||
* the focusstack keybindings to focus on other windows beneath the current window.
|
* the focusstack keybindings to focus on other windows beneath the current window.
|
||||||
* It is also possible to spawn new windows (e.g. a terminal) that end up getting
|
* It is also possible to spawn new windows (e.g. a terminal) that end up getting
|
||||||
|
Loading…
Reference in New Issue
Block a user