You are not logged in.
6.0 :-) I only found posts from 2008.
Last edited by inch (2013-02-25 19:14:05)
Offline
Offline
Appreciate it, thank you.
Offline
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
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
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
Check this out.
do i apply this as a patch?
Offline
Share dwm patches
My bad, won't happen again. I'm sorry.
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
mkaito, ok, will give it a shot, thanks !
Offline
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...
Offline
My bad, won't happen again. I'm sorry.
Offline
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
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
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
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
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
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,
Offline
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
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
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
@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)
Offline
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
@ivoarch: That single 'hide tags' tweak made my day. Thank you.
Offline
@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
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)
Offline