You are not logged in.

#226 2011-07-11 09:42:02

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: DWM Hackers Unite! Share (or request) dwm patches.

Yesterday dwm-5.9 was released.

http://thread.gmane.org/gmane.comp.misc.suckless/6652

Is anyone using 5.9 yet? Also, i couldn't really find a changelog. Can someone tell what are the changes, and if it's worth upgrading. I am using 5.8.2.

Offline

#227 2011-07-11 09:46:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

There have been incremental changes over the last several months: you can look back through the ML archive to see what has been added.

Anselm is planning a significant rewrite for the next release apparently. All of the patches that I was using on 5.8.2-2 worked without issue except the statuscolours patch from the ML, and that only required minor tweaking.

It's all good.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#228 2011-07-11 09:52:03

nixfag
Member
From: Romania
Registered: 2011-03-03
Posts: 73

Re: DWM Hackers Unite! Share (or request) dwm patches.

Anyone knows how do I ignore package dwm from upgrading?I just Syu-ed today and dwm came up,I was like holy shit and rapidly hit ^C.I was installing it from ABS.

Offline

#229 2011-07-11 09:53:20

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: DWM Hackers Unite! Share (or request) dwm patches.

add it to the ignore list in /etc/pacman.conf?

Offline

#230 2011-07-11 09:54:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Two strategies:
1. https://wiki.archlinux.org/index.php/Pa … g_upgraded
2. Add it to a group (I use modified) and add the modified group to IgnoreGroup


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#231 2011-07-11 12:32:59

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

x33a wrote:

Is anyone using 5.9 yet? Also, i couldn't really find a changelog. Can someone tell what are the changes, and if it's worth upgrading. I am using 5.8.2.

Yes, since I'm using some kind of dwm-hg.

For a changelog, visit: http://hg.suckless.org/dwm/log

Offline

#232 2011-07-11 20:59:32

markbabc
Member
Registered: 2010-11-06
Posts: 157

Re: DWM Hackers Unite! Share (or request) dwm patches.

jasonwryan wrote:

There have been incremental changes over the last several months: you can look back through the ML archive to see what has been added.

Anselm is planning a significant rewrite for the next release apparently. All of the patches that I was using on 5.8.2-2 worked without issue except the statuscolours patch from the ML, and that only required minor tweaking.

It's all good.

What exactly is being re-written? Also does he have a blog where I can read about what hes planning? (i cant seem to find one...)

Offline

#233 2011-07-11 21:03:40

el mariachi
Member
Registered: 2007-11-30
Posts: 595

Re: DWM Hackers Unite! Share (or request) dwm patches.

maybe the mail-list is the best place to search for that wink

Offline

#234 2011-07-11 21:34:50

steve___
Member
Registered: 2008-02-24
Posts: 452

Re: DWM Hackers Unite! Share (or request) dwm patches.

markbabc wrote:

What exactly is being re-written? Also does he have a blog where I can read about what hes planning? (i cant seem to find one...)

It sounds like the multi-monitor support.

Offline

#235 2011-07-11 22:03:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: DWM Hackers Unite! Share (or request) dwm patches.

markbabc wrote:

What exactly is being re-written? Also does he have a blog where I can read about what hes planning? (i cant seem to find one...)

http://suckless.org/community
http://permalink.gmane.org/gmane.comp.m … kless/6652

Offline

#236 2011-07-12 20:38:03

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: DWM Hackers Unite! Share (or request) dwm patches.

x33a wrote:

Yesterday dwm-5.9 was released.

http://thread.gmane.org/gmane.comp.misc.suckless/6652

Is anyone using 5.9 yet? Also, i couldn't really find a changelog. Can someone tell what are the changes, and if it's worth upgrading. I am using 5.8.2.

I have no reason to upgrade to 5.9. 5.8.2 does everything I need, I have customized to exactly how I like it.

Maybe 6.0 will give me some challenges, which I shall accept with pleasure :-)

Offline

#237 2011-07-13 03:44:13

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: DWM Hackers Unite! Share (or request) dwm patches.

Looking at the dwm changelog from 5.8.2 to 5.9, I find my fullscreen patch has been applied. Interesting.
Just to clarify, although I do occasionally use other nicks, I'm no Jack Dagger.
I guess I was too lazy/unsure that I didn't send the patch to the ML.

I've also updated my scratchpad patch for dwm 5.9, now indenting using TABs for consistency with the original code. Minor fixes included.
I'm not updating the github repo, just pasting it here for now:

scratchpad.patch for dwm 5.9
A scratchpad is a window that is assigned the (hidden) scratchtag.
A window becomes a scratchpad if its WM_NAME at its creation time is the value
of the scratchpadname variable.
togglescratchpad() is actually a variant of toggleview().

To use this, put the following definitions in config.h:

static const char scratchpadname[] = "Scratchpad"; /* make it unique, avoid name collision */
static const char *scratchpadcmd[] = { "uxterm", "-title", scratchpadname, "-geometry", "80x20", NULL }; /* WM_NAME must be scratchpadname */

static Key keys[] = {
    { MODKEY|ControlMask,           XK_x,      spawn,            {.v = scratchpadcmd } }, /* for more scratchpads */
    { MODKEY,                       XK_x,      togglescratchpad, {.v = scratchpadcmd } },
}

BUGS

* With more than one scratchpad, a second scratch does not restore the focus
  state of the last scratch, but will always focus the first scratchpad that is
  found while looping through selmon->clients.
* With more than one scratchpad, only the focused (floating) scratchpad will be
  raised to top of the stack. I think a better behavior would be to raise all
  (floating) scratchpads to top of the stack.

diff -up a/dwm.c b/dwm.c
--- a/dwm.c    2011-07-13 12:00:00.000000000 +0000
+++ b/dwm.c    2011-07-13 12:00:00.000000000 +0000
@@ -224,6 +224,7 @@ static int textnw(const char *text, unsi
 static void tile(Monitor *);
 static void togglebar(const Arg *arg);
 static void togglefloating(const Arg *arg);
+static void togglescratchpad(const Arg *arg);
 static void toggletag(const Arg *arg);
 static void toggleview(const Arg *arg);
 static void unfocus(Client *c, Bool setfocus);
@@ -279,6 +280,9 @@ static Window root;
 /* configuration, allows nested code to access above variables */
 #include "config.h"
 
+/* any client in scratchtag is a scratchpad */
+static unsigned int scratchtag = 1 << LENGTH(tags);
+
 /* compile-time check if all tags fit into an unsigned int bit array. */
 struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
 
@@ -1135,6 +1139,17 @@ manage(Window w, XWindowAttributes *wa)
                    && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
         c->bw = borderpx;
     }
+    /* scratchpad */
+    if(!strcmp(c->name, scratchpadname)) {
+        c->mon->tagset[c->mon->seltags] |= c->tags = scratchtag;
+        c->isfloating = True;
+        c->x = (c->mon->mw - WIDTH(c)) / 2;
+        c->y = (c->mon->mh - HEIGHT(c)) / 2;
+    }
+    else {
+        /* anything else must stay out of scratchtag */
+        c->tags &= TAGMASK;
+    }
     wc.border_width = c->bw;
     XConfigureWindow(dpy, w, CWBorderWidth, &wc);
     XSetWindowBorder(dpy, w, dc.norm[ColBorder]);
@@ -1689,6 +1704,27 @@ togglefloating(const Arg *arg) {
 }
 
 void
+togglescratchpad(const Arg *arg) {
+    Client *c = NULL;
+    unsigned int found = 0;
+    /* check if a scratchpad already exists in scratchtag */
+    for(c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next);
+    if(found) {
+        unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
+        if(newtagset) {
+            selmon->tagset[selmon->seltags] = newtagset;
+            arrange(selmon);
+        }
+        if(ISVISIBLE(c)) {
+            focus(c);
+            restack(selmon);
+        }
+    }
+    else
+        spawn(arg); /* launch a new scratchpad, details handled by manage() */
+}
+
+void
 toggletag(const Arg *arg) {
     unsigned int newtags;
 

Edit: added restack() fix from JokerBoy.

Last edited by lolilolicon (2011-07-13 15:55:43)


This silver ladybug at line 28...

Offline

#238 2011-07-13 11:33:57

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Hey guys,
Are pertag and uselessgap patches working on dwm 5.9?


Github -- My terminal font Envypn

Offline

#239 2011-07-13 11:44:21

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

feel free to use pertag2 and gaps from here. smile

lolilolicon, you should at least test it in floating layout.. with this focus should work ok now.

    if(ISVISIBLE(c)) {
        focus(c);
        restack(selmon);
    }

Last edited by JokerBoy (2011-07-13 13:06:36)

Offline

#240 2011-07-13 13:42:30

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: DWM Hackers Unite! Share (or request) dwm patches.

Well, focus worked OK; I just didn't raise the the scratchpad wink
restack() should do, and I will test it later.
Thank you for your contribution.


This silver ladybug at line 28...

Offline

#241 2011-07-13 14:51:46

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Thanks Jokerboy. The mouse rox a lot!

I saw that section in your config.h

static const Tag tags[] = {
        /* name       layout           mfact    nmaster */
        { "main",     &layouts[4],     -1,      -1 },
        { "term",     &layouts[4],     -1,      -1 },
        { "web",      &layouts[2],     -1,      -1 },
        { "im",       &layouts[6],     0.17,    -1 },
        { "misc",     &layouts[4],     -1,      -1 },
};

It's a function to save layout per tag? What's the patch name please?

Last edited by Ypnose (2011-07-13 14:53:52)


Github -- My terminal font Envypn

Offline

#242 2011-07-13 15:00:26

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

That part is for: 01-dwm-5.9-pertag2.diff

Offline

#243 2011-07-13 15:09:05

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Yeah.
It was a strange question, because on my pertag patch from suckless.org, it doesn't add these functions.

Last edited by Ypnose (2011-07-13 15:09:19)


Github -- My terminal font Envypn

Offline

#244 2011-07-13 15:27:41

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

it's a custom version of https://github.com/simongmzlj/dwmhacks/ … rtag2.diff which adds a nicer version of ntile and fixes a segfault when you restart dwm on-the-fly.

here's the config patch for pertag2.

--- a/config.def.h    2011-07-10 23:25:23.000000000 +0300
+++ b/config.def.h    2011-07-13 18:25:53.083000111 +0300
@@ -13,9 +13,6 @@ static const unsigned int snap      = 32
 static const Bool showbar           = True;     /* False means no bar */
 static const Bool topbar            = True;     /* False means bottom bar */
 
-/* tagging */
-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-
 static const Rule rules[] = {
     /* class      instance    title       tags mask     isfloating   monitor */
     { "Gimp",     NULL,       NULL,       0,            True,        -1 },
@@ -23,6 +20,7 @@ static const Rule rules[] = {
 };
 
 /* layout(s) */
+static const int nmaster      = 1;    /* clients in the master area */
 static const float mfact      = 0.55; /* factor of master area size [0.05..0.95] */
 static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
 
@@ -31,6 +29,21 @@ static const Layout layouts[] = {
     { "[]=",      tile },    /* first entry is default */
     { "><>",      NULL },    /* no layout function means floating behavior */
     { "[M]",      monocle },
+    { "[N]",      ntile },
+};
+
+/* tagging */
+static const Tag tags[] = {
+    /* name       layout           mfact    nmaster */
+    { "1",        &layouts[0],     -1,      -1 },
+    { "2",        &layouts[1],     -1,      -1 },
+    { "3",        &layouts[2],     -1,      -1 },
+    { "4",        &layouts[3],     0.40,    -1 },
+    { "5",        &layouts[0],     -1,      -1 },
+    { "6",        &layouts[0],     -1,      -1 },
+    { "7",        &layouts[0],     -1,      -1 },
+    { "8",        &layouts[0],     -1,      -1 },
+    { "9",        &layouts[0],     -1,      -1 },
 };
 
 /* key definitions */
@@ -55,6 +68,8 @@ static Key keys[] = {
     { MODKEY,                       XK_b,      togglebar,      {0} },
     { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
     { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
+    { MODKEY,                       XK_a,      incnmaster,     {.i = +1 } },
+    { MODKEY,                       XK_z,      incnmaster,     {.i = -1 } },
     { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
     { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
     { MODKEY,                       XK_Return, zoom,           {0} },
@@ -63,6 +78,7 @@ static Key keys[] = {
     { MODKEY,                       XK_t,      setlayout,      {.v = &layouts[0]} },
     { MODKEY,                       XK_f,      setlayout,      {.v = &layouts[1]} },
     { MODKEY,                       XK_m,      setlayout,      {.v = &layouts[2]} },
+    { MODKEY,                       XK_n,      setlayout,      {.v = &layouts[3]} },
     { MODKEY,                       XK_space,  setlayout,      {0} },
     { MODKEY|ShiftMask,             XK_space,  togglefloating, {0} },
     { MODKEY,                       XK_0,      view,           {.ui = ~0 } },

Offline

#245 2011-07-13 16:42:22

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

Dude, your custom version doesn't work when i try to patch under ~/dwm/src/dwm-5.9 with:

patch -p1 < 01-dwm-5.9-pertag2.diff

But the pertag2 from simongmzlj, succeed.


Github -- My terminal font Envypn

Offline

#246 2011-07-13 16:48:21

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

what is the output of that command? "doesn't work" isn't quite an error report.

┌─[bogdan@pc][~pabs/community/dwm]
└─╼ makepkg -o
==> Making package: dwm 5.9-1 (Wed Jul 13 19:47:27 EEST 2011)
==> Retrieving Sources...
  -> Found dwm-5.9.tar.gz
  -> Found config.h
  -> Found dwm.desktop
==> Validating source files with md5sums...
    dwm-5.9.tar.gz ... Passed
    config.h ... Passed
    dwm.desktop ... Passed
==> Extracting Sources...
  -> Extracting dwm-5.9.tar.gz with bsdtar
==> Sources are ready.
┌─[bogdan@pc][~pabs/community/dwm]
└─╼ cd src/dwm-5.9 
LICENSE  Makefile  README  config.def.h  config.mk  dwm.c  dwm.1
┌─[bogdan@pc][~pabs/community/dwm/src/dwm-5.9]
└─╼ patch -p1 < ~build/01-dwm-5.9-pertag2.diff 
patching file dwm.c
┌─[bogdan@pc][~pabs/community/dwm/src/dwm-5.9]
└─╼ 

Offline

#247 2011-07-13 17:10:11

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: DWM Hackers Unite! Share (or request) dwm patches.

My bad.
Here the output:

╒══|cobramad@madhost|════════╕[~]
└─[$]─> cd /dwm/src/dwm-5.9
╒══|cobramad@madhost|════════╕[~/dwm/src/dwm-5.9]
└─[$]─> ls
01-dwm-5.9-pertag2.diff
config.def.h
config.h
config.mk
dwm
dwm.1
dwm.c
dwm.o
LICENSE
log.txt
Makefile
README
╒══|cobramad@madhost|════════╕[~/dwm/src/dwm-5.9]
└─[$]─> patch -p1 < 01-dwm-5.9-pertag2.diff
patching file dwm.c
Hunk #1 FAILED at 124.
Hunk #2 FAILED at 140.
Hunk #3 FAILED at 244.
Hunk #4 FAILED at 434.
Hunk #5 FAILED at 506.
Hunk #6 FAILED at 651.
Hunk #7 FAILED at 735.
Hunk #8 FAILED at 1498.
Hunk #9 FAILED at 1513.
Hunk #10 FAILED at 1650.
Hunk #11 FAILED at 1691.
Hunk #12 FAILED at 1967.
Hunk #13 succeeded at 2080 with fuzz 1 (offset 31 lines).
12 out of 13 hunks FAILED -- saving rejects to file dwm.c.rej

Github -- My terminal font Envypn

Offline

#248 2011-07-13 17:22:02

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: DWM Hackers Unite! Share (or request) dwm patches.

hmm, apply it by hand. smile

Offline

#249 2011-07-14 02:09:38

Shrak
Member
Registered: 2011-07-14
Posts: 12

Re: DWM Hackers Unite! Share (or request) dwm patches.

Any chance to get a working pango/xft patch for 5.9?

Offline

#250 2011-07-14 06:43:45

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: DWM Hackers Unite! Share (or request) dwm patches.

@Shrak, I updated the pango patch from AUR/pango for dwm 5.9 several days ago:
https://gist.github.com/1082030

It's only some offsetting stuff.
I didn't use it because it breaks my other patches... hmm


This silver ladybug at line 28...

Offline

Board footer

Powered by FluxBB