Return to repo list

suckless-gf-dwm

Gentoo-friendly patches for Suckless's dwm.
Return to HMagellan.com

commit 81e72b87099ef472260107a246242cee168e8353
parent 070c2cdc4b405d72b6d5774b888beb43fc389708
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 12 Aug 2020 00:34:43 -0500

Added alwaysontop

Diffstat:
MREADME | 2+-
Mactualfullscreen/USAGE | 2+-
Aalwaysontop/USAGE | 23+++++++++++++++++++++++
Aalwaysontop/alwaysontop.patch | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 112 insertions(+), 2 deletions(-)

diff --git a/README b/README @@ -42,7 +42,7 @@ patches! (1). https://dwm.suckless.org/patches/ - CURRENT PROGRESS: 8/172 patches supported + CURRENT PROGRESS: 9/172 patches supported 1/172 patches unsupported USUPPORTED PATCHES: diff --git a/actualfullscreen/USAGE b/actualfullscreen/USAGE @@ -19,4 +19,4 @@ Description from source: (1). Removed lines relating to config.def.h == INCOMPATIBILITIES == -No known specific incompatibilities. +(1). This patch is known to be incompatible with the 'alwaysontop' patch. diff --git a/alwaysontop/USAGE b/alwaysontop/USAGE @@ -0,0 +1,23 @@ +alwaysontop - Keeps a floating window always in view +Source: https://dwm.suckless.org/patches/alwaysontop/alwaysontop-6.2.diff +Original Author: Rob Pilling - robpilling@gmail.com + +Description from source: + """ + Choose one floating window to be always-on-top - this prevents other floating windows from + being raised above it. Useful for playing films, etc. + """ + +== YOU MUST == +(1). Place the patch file in /etc/portage/patches/x11-wm/dwm/ and run 'emerge dwm' + +== YOU PROBABLY SHOULD == +(1). Create a key binding for 'togglealwaysontop', for example: + + { MODKEY|ShiftMask, XK_space, togglealwaysontop, {0} }, + +== PATCH MODIFICATIONS == +(1). Re-implemented patch with diff -up rather than git-style, since portage didn't like the original. + +== INCOMPATIBILITIES == +(1). This patch is known to be incompatible with the 'actualfullscreen' patch. diff --git a/alwaysontop/alwaysontop.patch b/alwaysontop/alwaysontop.patch @@ -0,0 +1,87 @@ +--- a/dwm.c 2020-08-12 00:03:34.473910344 -0500 ++++ b/dwm.c 2020-08-11 23:44:39.454957969 -0500 +@@ -92,7 +92,7 @@ struct Client { + int basew, baseh, incw, inch, maxw, maxh, minw, minh; + int bw, oldbw; + unsigned int tags; +- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; ++ int isfixed, isfloating, isalwaysontop, isurgent, neverfocus, oldstate, isfullscreen; + Client *next; + Client *snext; + Monitor *mon; +@@ -211,6 +211,7 @@ static void tagmon(const Arg *arg); + static void tile(Monitor *); + static void togglebar(const Arg *arg); + static void togglefloating(const Arg *arg); ++static void togglealwaysontop(const Arg *arg); + static void toggletag(const Arg *arg); + static void toggleview(const Arg *arg); + static void unfocus(Client *c, int setfocus); +@@ -732,8 +733,11 @@ drawbar(Monitor *m) + if (m->sel) { + drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); + drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); +- if (m->sel->isfloating) ++ if (m->sel->isfloating) { + drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); ++ if (m->sel->isalwaysontop) ++ drw_rect(drw, x + boxs, bh - boxw, boxw, boxw, 0, 0); ++ } + } else { + drw_setscheme(drw, scheme[SchemeNorm]); + drw_rect(drw, x, 0, w, bh, 1, 1); +@@ -1356,6 +1360,17 @@ restack(Monitor *m) + return; + if (m->sel->isfloating || !m->lt[m->sellt]->arrange) + XRaiseWindow(dpy, m->sel->win); ++ ++ /* raise the aot window */ ++ for(Monitor *m_search = mons; m_search; m_search = m_search->next){ ++ for(c = m_search->clients; c; c = c->next){ ++ if(c->isalwaysontop){ ++ XRaiseWindow(dpy, c->win); ++ break; ++ } ++ } ++ } ++ + if (m->lt[m->sellt]->arrange) { + wc.stack_mode = Below; + wc.sibling = m->barwin; +@@ -1716,10 +1731,36 @@ togglefloating(const Arg *arg) + if (selmon->sel->isfloating) + resize(selmon->sel, selmon->sel->x, selmon->sel->y, + selmon->sel->w, selmon->sel->h, 0); ++ else ++ selmon->sel->isalwaysontop = 0; /* disabled, turn this off too */ + arrange(selmon); + } + + void ++togglealwaysontop(const Arg *arg) ++{ ++ if (!selmon->sel) ++ return; ++ if (selmon->sel->isfullscreen) ++ return; ++ ++ if(selmon->sel->isalwaysontop){ ++ selmon->sel->isalwaysontop = 0; ++ }else{ ++ /* disable others */ ++ for(Monitor *m = mons; m; m = m->next) ++ for(Client *c = m->clients; c; c = c->next) ++ c->isalwaysontop = 0; ++ ++ /* turn on, make it float too */ ++ selmon->sel->isfloating = 1; ++ selmon->sel->isalwaysontop = 1; ++ } ++ ++ arrange(selmon); ++} ++ ++void + toggletag(const Arg *arg) + { + unsigned int newtags;