You are not logged in.

#1101 2013-02-25 19:13:44

inch
Member
Registered: 2010-12-21
Posts: 49

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

6.0 :-) I only found posts from 2008.

Last edited by inch (2013-02-25 19:14:05)

Offline

#1102 2013-02-25 19:52:31

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

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


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#1103 2013-02-25 22:11:01

inch
Member
Registered: 2010-12-21
Posts: 49

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

Appreciate it, thank you.

Offline

#1104 2013-02-26 06:22:52

OK100
Member
From: [U==]
Registered: 2010-04-26
Posts: 453

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

inch wrote:

Is there a recent version of the xbm layout icon patch?

This one has numbered monocle icons: https://raw.github.com/ok100/dwm/673ccb … icons.diff
Example config.h: https://github.com/ok100/dwm/blob/673cc … 0/config.h

Last edited by OK100 (2013-02-26 06:26:55)

Offline

#1105 2013-03-01 18:29:18

skrite
Member
Registered: 2009-09-07
Posts: 160

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

hey all, loving dwm, i am trying to find a way to hide empty tags (like on wmii or i3),
is this possible in dwm?

thanks for any tips.

Offline

#1106 2013-03-01 19:16:24

mkaito
Member
From: Spain
Registered: 2010-06-12
Posts: 121
Website

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

skrite wrote:

hey all, loving dwm, i am trying to find a way to hide empty tags (like on wmii or i3),
is this possible in dwm?

thanks for any tips.

Check this out.


Fear me! I have root! Sometimes...

Offline

#1107 2013-03-01 19:18:57

skrite
Member
Registered: 2009-09-07
Posts: 160

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

mkaito wrote:

Check this out.

do i apply this as a patch?

Offline

#1108 2013-03-01 19:20:06

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,761
Website

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

skrite wrote:
mkaito wrote:

Check this out.

do i apply this as a patch?

thread title wrote:

Share dwm patches


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#1109 2013-03-01 19:32:46

mkaito
Member
From: Spain
Registered: 2010-06-12
Posts: 121
Website

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

thread title wrote:

Share dwm patches

My bad, won't happen again. I'm sorry.

skrite wrote:
mkaito wrote:

Check this out.

do i apply this as a patch?

No. It's not a clean diff against stock dwm. It's just a way to show how I did it (read: copied from someone else and fixed to make it work with my other patches).

Random rambling: I recently had the epiphany that using dwm without having a clue of how it works and just blindly applying patches (which I didn't understand either) was a pretty bad idea. So I buckled down, learned some C, and read the dwm source. Also moved from having a dozen .diff files and a PKGBUILD to having the repo linked above, where I manually patch/hack/edit dwm myself. Hence, I don't have any clean patches to share, and I have little motivation to make them, but the git commit diffs should be enough for someone to replicate the desired functionality on his dwm tree.


Fear me! I have root! Sometimes...

Offline

#1110 2013-03-01 19:34:05

skrite
Member
Registered: 2009-09-07
Posts: 160

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

mkaito, ok, will give it a shot, thanks !

Offline

#1111 2013-03-01 20:31:11

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 18,761
Website

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

mkaito wrote:
thread title wrote:

Share dwm patches

My bad, won't happen again. I'm sorry.


It wasn't directed at you. skrite was asking what to do with your diff; I was pointing out that the question seemed rather redundant in this thread...


Arch + dwm   •   Mercurial repos  •   Github

Registered Linux User #482438

Offline

#1112 2013-03-01 20:38:25

skrite
Member
Registered: 2009-09-07
Posts: 160

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

My bad, won't happen again. I'm sorry.

Offline

#1113 2013-03-01 20:54:42

andmars
Member
Registered: 2012-03-13
Posts: 155

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

mkaito wrote:

Random rambling: I recently had the epiphany that using dwm without having a clue of how it works and just blindly applying patches (which I didn't understand either) was a pretty bad idea. So I buckled down, learned some C, and read the dwm source. Also moved from having a dozen .diff files and a PKGBUILD to having the repo linked above, where I manually patch/hack/edit dwm myself. Hence, I don't have any clean patches to share, and I have little motivation to make them, but the git commit diffs should be enough for someone to replicate the desired functionality on his dwm tree.

That's exactly my experience with dwm. I'm using monsterwm which already has all the patches I need (pertag, push, etc) included. But I wanted to learn more about my tiling-wm, installed dwm and applied the patches myself, only to find out that I didn't really know what I was doing. So I grabbed myself a good book on learning C from the local library and I'm studying it for about 4-5 days now.

Offline

#1114 2013-03-05 18:40:43

F34R
Member
From: /dev/loliland
Registered: 2012-02-05
Posts: 238

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

whatever , i'm not really meant how to patches dwm , merge some .diff from any config and edit config.h only. Prolblem i get some error with indentity , type makepkg -g >> PKBUILD and run again makepkg -i . Already get some errors in push.c .

Offline

#1115 2013-03-05 18:52:36

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

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

F34R wrote:

whatever , i'm not really meant how to patches dwm , merge some .diff from any config and edit config.h only. Prolblem i get some error with indentity , type makepkg -g >> PKBUILD and run again makepkg -i . Already get some errors in push.c .

Can you post what errors you are having ?


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#1116 2013-03-05 19:14:04

andmars
Member
Registered: 2012-03-13
Posts: 155

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

F34R wrote:

type makepkg -g >> PKBUILD and run again makepkg -i . Already get some errors in push.c .

When I first wanted to try DWM I used the ABS method as it is described in the Arch Wiki, too (with makepkg -g >> PKGBUILD and makepkg-i). But applying patches from the suckless.org website to these files often failed and it didn't really work.
So I cloned the git repo of dwm (git clone http://git.suckless.org/dwm) and applyed the patches with: patch -p1 < path/to/patch.diff
This worked much better installing DWM with: sudo make and sudo make clean install.
Maybe you want to try this method and report back if the errors still occur?

Offline

#1117 2013-03-05 20:58:03

KaiSforza
Member
Registered: 2012-04-22
Posts: 133
Website

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

I would recommend getting a git clone (as andmars said) then using git to track patches.

git clone git://git.suckless.org/dwm
cd dwm
git checkout -b patched
git apply /path/to/patch.diff
git commit -av

This way you can track patches using git, instead of just keeping them in a directory. I just think that keeping patches when you've got a git repository is stupid.


Thinkpad T420 | Intel 3000 | systemd {,--user}
PKGBUILDs I use | pywer AUR helper

Offline

#1118 2013-03-05 21:08:45

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

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

skrite wrote:

hey all, loving dwm, i am trying to find a way to hide empty tags (like on wmii or i3),
is this possible in dwm?

thanks for any tips.

Much easier

--- dwm.c.orig	2013-03-05 22:00:33.995178877 +0100
+++ dwm.c	2013-03-05 21:56:05.920460722 +0100
@@ -723,6 +723,8 @@
 	dc.x = 0;
 	for(i = 0; i < LENGTH(tags); i++) {
 		dc.w = TEXTW(tags[i]);
+                if (!((occ | m->tagset[m->seltags]) & 1 << i))
+			continue;
 		col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
 		drawtext(tags[i], col, urg & 1 << i);
 		drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,

I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#1119 2013-03-05 22:34:18

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

Thanks ivoarch, that one's really cool!!

And in this case you can also get rid of the squares, which originally indicate, which tag contains clients.
And, if you want to optimize the height of the bar (well at least I do), you can make it more flat by 2 pixels wink

diff -paur dwm.old/dwm.c dwm.new/dwm.c
--- dwm.old/dwm.c	2013-03-05 23:29:08.648168901 +0100
+++ dwm.new/dwm.c	2013-03-05 23:32:11.596353223 +0100
@@ -723,10 +723,10 @@ drawbar(Monitor *m) {
 	dc.x = 0;
 	for(i = 0; i < LENGTH(tags); i++) {
 		dc.w = TEXTW(tags[i]);
+		if (!((occ | m->tagset[m->seltags]) & 1 << i))
+			continue;
 		col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
 		drawtext(tags[i], col, urg & 1 << i);
-		drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
-		           occ & 1 << i, urg & 1 << i, col);
 		dc.x += dc.w;
 	}
 	dc.w = blw = TEXTW(m->ltsymbol);
@@ -1600,7 +1600,7 @@ setup(void) {
 	initfont(font);
 	sw = DisplayWidth(dpy, screen);
 	sh = DisplayHeight(dpy, screen);
-	bh = dc.h = dc.font.height + 2;
+	bh = dc.h = dc.font.height;
 	updategeom();
 	/* init atoms */
 	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);

Last edited by Army (2013-03-05 22:37:44)

Offline

#1120 2013-03-06 06:50:08

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

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

I'm just getting around to upgrading from 5.9 to 6.0 and I'm having a heck of a time applying the xft and systray patches (hosted at suckless.org) to the vanilla 6.0 files. After manually applying the failed hunks, I get compile errors regarding incompatible arguments in XCreateSimpleWindow and incompatible types when assigning to type ‘long unsigned int’ from type ‘XftColor’.

dwm.c: In function ‘updatesystray’:
dwm.c:2239:3: error: incompatible type for argument 9 of ‘XCreateSimpleWindow’
In file included from dwm.c:36:0:
/usr/include/X11/Xlib.h:1629:15: note: expected ‘long unsigned int’ but argument is of type ‘XftColor’
dwm.c:2243:24: error: incompatible types when assigning to type ‘long unsigned int’ from type ‘XftColor’
make: *** [dwm.o] Error 1

Am I missing something painfully obvious here? FWIW I don't want the statuscolors patch which many configs in the wild seem to combine with the above two patches.

Edit: Thank you, ivoarch and Unia. I'll give it another try when I get home today.

Last edited by thayer (2013-03-06 15:54:39)


thayer williams ~ cinderwick.ca

Offline

#1121 2013-03-06 08:25:37

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

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

@Army
Thanks!!
I only share, this patch is not mine.

@thayer
I think that you have to replace these two lines in Updatesystray func..

 
void
updatesystray(void) {

- systray->win = XCreateSimpleWindow(dpy, root, x, selmon->by, w, bh, 0, 0, dc.sel[ColBG]);  
+ systray->win = XCreateSimpleWindow(dpy, root, x, selmon->by, w, bh, 0, 0, dc.sel[ColBG].pixel);  
 
- wa.background_pixel = dc.norm[ColBG];
+ wa.background_pixel = dc.norm[ColBG].pixel;

Last edited by ivoarch (2013-03-06 08:33:08)


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#1122 2013-03-06 13:16:21

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,471
Website

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

Otherwise, you can look at my GitHub. I still have my XFT and systray patches up there for DWM 6.0.


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#1123 2013-03-06 15:40:23

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

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

@ivoarch: That single 'hide tags' tweak made my day.  Thank you. smile

Offline

#1124 2013-03-06 17:31:45

Army
Member
Registered: 2007-12-07
Posts: 1,784

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

ivoarch wrote:

@Army
Thanks!!
I only share, this patch is not mine.

In that case, thanks for sharing, because I used another patch up till now which was much more complicated.

edit: Just found out, that with your patch clicking on the tags by mouse doesn't work right anymore. For those who use this sometimes, the following patch should be better.

diff -paur dwm.old/dwm.c dwm.new/dwm.c
--- dwm.old/dwm.c	2012-12-14 21:12:12.554228914 +0100
+++ dwm.new/dwm.c	2012-12-14 21:12:17.607610122 +0100
@@ -55,6 +55,7 @@
 #define HEIGHT(X)               ((X)->h + 2 * (X)->bw)
 #define TAGMASK                 ((1 << LENGTH(tags)) - 1)
 #define TEXTW(X)                (textnw(X, strlen(X)) + dc.font.height)
+#define ISTAGVISIBLE(M, OCC, I) (OCC & 1 << I || M->tagset[M->seltags] & 1 << I)
 
 /* enums */
 enum { CurNormal, CurResize, CurMove, CurLast };        /* cursor */
@@ -426,7 +427,7 @@ attachstack(Client *c) {
 
 void
 buttonpress(XEvent *e) {
-	unsigned int i, x, click;
+	unsigned int i, x, click, occ = 0;
 	Arg arg = {0};
 	Client *c;
 	Monitor *m;
@@ -439,10 +440,13 @@ buttonpress(XEvent *e) {
 		selmon = m;
 		focus(NULL);
 	}
+	for(c = selmon->clients; c; c = c->next)
+		occ |= c->tags;
 	if(ev->window == selmon->barwin) {
 		i = x = 0;
 		do
-			x += TEXTW(tags[i]);
+			if (ISTAGVISIBLE(selmon, occ, i))
+				x += TEXTW(tags[i]);
 		while(ev->x >= x && ++i < LENGTH(tags));
 		if(i < LENGTH(tags)) {
 			click = ClkTagBar;
@@ -462,7 +466,7 @@ buttonpress(XEvent *e) {
 	for(i = 0; i < LENGTH(buttons); i++)
 		if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
 		&& CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
-			buttons[i].func(click == ClkTagBar && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
+			buttons[i].func((click == ClkTagBar || click == ClkWinTitle) && buttons[i].arg.i == 0 ? &arg : &buttons[i].arg);
 }
 
 void
@@ -722,12 +726,12 @@ drawbar(Monitor *m) {
 	}
 	dc.x = 0;
 	for(i = 0; i < LENGTH(tags); i++) {
-		dc.w = TEXTW(tags[i]);
-		col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
-		drawtext(tags[i], col, urg & 1 << i);
-		drawsquare(m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
-		           occ & 1 << i, urg & 1 << i, col);
-		dc.x += dc.w;
+		if (ISTAGVISIBLE(m, occ, i)) {
+			dc.w = TEXTW(tags[i]);
+			col = m->tagset[m->seltags] & 1 << i ? dc.sel : dc.norm;
+			drawtext(tags[i], col, urg & 1 << i);
+			dc.x += dc.w;
+		}
 	}
 	dc.w = blw = TEXTW(m->ltsymbol);
 	drawtext(m->ltsymbol, dc.norm, False);
@@ -1600,7 +1604,7 @@ setup(void) {
 	initfont(font);
 	sw = DisplayWidth(dpy, screen);
 	sh = DisplayHeight(dpy, screen);
-	bh = dc.h = dc.font.height + 2;
+	bh = dc.h = dc.font.height;
 	updategeom();
 	/* init atoms */
 	wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);

Last edited by Army (2013-03-06 19:35:29)

Offline

#1125 2013-03-06 21:28:25

ivoarch
Member
From: the six feet under the ground
Registered: 2011-03-31
Posts: 436

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

Yes you are right Army,
clicking on the tags doesn't work right.

I found this http://lists.suckless.org/dev/1208/12107.html

Last edited by ivoarch (2013-03-06 21:42:55)


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

Board footer

Powered by FluxBB