You are not logged in.

#151 2011-01-26 10:27:20

bsdard
Member
From: Surrey, UK
Registered: 2011-01-22
Posts: 15

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

Try using awesome or wmii (the config file is actually the bash script).
I believe you can do a lot in the config file without messing too much with the code.

Offline

#152 2011-01-26 10:33:45

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

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

kcirick wrote:

I like the dwm's bar, but I don't really like the master/stack concept. I like how i3 manages clients, but it's very hard to hack and fine-tune the code to my liking. I just wish there was a happy median.

You should file a feature request at the i3 bugtracker, if you have sensible ideas for improvement i'm sure they will consider implementing them.

Ontopic: i'd be really interested in a dwm patch that allows hex-colors to be used in the status bar area, instead of global colors defined in the config.h like statuscolors does (which doesn't seem to apply to dwm > 5.7.2 anyway).


ᶘ ᵒᴥᵒᶅ

Offline

#153 2011-01-26 15:02:37

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

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

there is a patch for statuscolors for dwm 5.8.
Google it or look on github, it has been mentioned in the dwm patch thread.


.:[ git me! ] :.

Offline

#154 2011-01-26 15:18:18

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

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

c00kiemon5ter wrote:

there is a patch for statuscolors for dwm 5.8.
Google it or look on github, it has been mentioned in the dwm patch thread.

I still want the hex-colors. wink

The statuscolor approach is, in my opinion, really poor.


ᶘ ᵒᴥᵒᶅ

Offline

#155 2011-01-26 19:03:43

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

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

portix wrote:

There was someone on #archlinux who asked for a patch, that only shows active tags. I don't know, if there is already such a patch so i created one:

snip

with this you can use your mouse also..

--- dwm.c.orig    2010-06-04 13:39:15.000000000 +0300
+++ dwm.c    2011-01-26 21:01:29.674999762 +0200
@@ -53,6 +53,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 */
@@ -419,7 +420,7 @@
 
 void
 buttonpress(XEvent *e) {
-    unsigned int i, x, click;
+    unsigned int i, x, click, occ = 0;
     Arg arg = {0};
     Client *c;
     Monitor *m;
@@ -432,10 +433,13 @@
         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;
@@ -455,7 +459,7 @@
     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
@@ -695,12 +699,14 @@
     }
     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);
+            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);
     drawtext(m->ltsymbol, dc.norm, False);

Offline

#156 2011-01-28 07:02:05

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

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

JokerBoy wrote:

with this you can use your mouse also..

...............

Thanks, i don't use the mouse. But i'm sure someone will find it useful smile

Offline

#157 2011-02-23 02:34:28

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

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

litemotiv wrote:
c00kiemon5ter wrote:

there is a patch for statuscolors for dwm 5.8.
Google it or look on github, it has been mentioned in the dwm patch thread.

I still want the hex-colors. wink

The statuscolor approach is, in my opinion, really poor.

This - and the ability to add a 1px border under the statusbar for purely selfish aesthetic reasons are the only reasons I have a quick play with other wm's.  I always end up back with dwm though, you can't have everything I guess.


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#158 2011-02-23 14:05:03

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

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

Meyithi wrote:
litemotiv wrote:
c00kiemon5ter wrote:

there is a patch for statuscolors for dwm 5.8.
Google it or look on github, it has been mentioned in the dwm patch thread.

I still want the hex-colors. wink

The statuscolor approach is, in my opinion, really poor.

This - and the ability to add a 1px border under the statusbar for purely selfish aesthetic reasons are the only reasons I have a quick play with other wm's.  I always end up back with dwm though, you can't have everything I guess.

The hex colour patch maybe a little complicated, but adding 1px border under the stat bar should be fairly straight forward. Just look at drawbar() function.

Offline

#159 2011-02-24 09:48:22

0mark
Member
From: earth
Registered: 2010-06-09
Posts: 162
Website

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

litemotiv wrote:
c00kiemon5ter wrote:

there is a patch for statuscolors for dwm 5.8.
Google it or look on github, it has been mentioned in the dwm patch thread.

I still want the hex-colors. wink

The statuscolor approach is, in my opinion, really poor.

I think simongmzlj has a hex-colors patch. My patchset also has hex colors, but i have no single patch for that  (anyway, through svn misusing the current version does not work, but i fix that later this day).


Ceterum autem censeo Systemdinem esse delendam

Offline

#160 2011-02-25 03:45:26

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

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

portix wrote:

There was someone on #archlinux who asked for a patch, that only shows active tags. I don't know, if there is already such a patch so i created one:

diff -u dwm-5.8.2.orig//dwm.c dwm-5.8.2/dwm.c
--- dwm-5.8.2.orig//dwm.c    2011-01-22 16:26:44.000000000 +0100
+++ dwm-5.8.2/dwm.c    2011-01-22 16:29:04.000000000 +0100
@@ -695,12 +695,14 @@
     }
     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,
+        if (occ & 1 << i || m->tagset[m->seltags] & 1 << 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;
+            dc.x += dc.w;
+        }
     }
     dc.w = blw = TEXTW(m->ltsymbol);
     drawtext(m->ltsymbol, dc.norm, False);

First of all, thanks for creating this patch. I am using it now. I've noticed that ClkTagBar didn't really work as it should. For example, if I have Tag1 and Tag3 occupied, and if I have Tag4 selected, and if I click on Tag3, it will actually go to Tag2, because without the patch, I would be clicking where it should say "Tag2". Conversely, if I want to select Tag9, then I would have to click somewhere where the window title is drawn where Tag9 would be without the patch. To avoid this, I made another modification:

 void buttonpress(XEvent *e) {
    unsigned int i, x, click;
+    unsigned int occ = 0;
    Arg arg = {0};
    Client *c;
    Monitor *m;
    XButtonPressedEvent *ev = &e->xbutton;
 
    click = ClkRootWin;
    /* focus monitor if necessary */
    if((m = wintomon(ev->window)) && m != selmon) {
       unfocus(selmon->sel, True);
       selmon = m;
       focus(NULL);
    }
    if(ev->window == selmon->barwin) {
       i = x = 0;
+       for(c = m->clients; c; c= c->next){
+             occ |= c->tags;
+       }
       do {
+          if(occ & 1 << i || m->tagset[m->seltags] & 1 << i)
             x += TEXTW(tags[i]);
       } while(ev->x >= x && ++i < LENGTH(tags));
       if(i < LENGTH(tags)) {
          click = ClkTagBar;
          arg.ui = 1 << i;
       }
    } else if((c = wintoclient(ev->window))) {
       focus(c);
       click = ClkClientWin;
    }
    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);
 }

I hope this is clear...

Last edited by kcirick (2011-02-25 03:48:31)

Offline

#161 2011-02-25 03:53:23

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

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

JokerBoy wrote:
portix wrote:

There was someone on #archlinux who asked for a patch, that only shows active tags. I don't know, if there is already such a patch so i created one:

snip

with this you can use your mouse also..

--- dwm.c.orig    2010-06-04 13:39:15.000000000 +0300
+++ dwm.c    2011-01-26 21:01:29.674999762 +0200
@@ -53,6 +53,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 */
@@ -419,7 +420,7 @@
 
 void
 buttonpress(XEvent *e) {
-    unsigned int i, x, click;
+    unsigned int i, x, click, occ = 0;
     Arg arg = {0};
     Client *c;
     Monitor *m;
@@ -432,10 +433,13 @@
         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;
@@ -455,7 +459,7 @@
     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
@@ -695,12 +699,14 @@
     }
     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);
+            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);
     drawtext(m->ltsymbol, dc.norm, False);

oh snap..

Offline

#162 2011-02-25 04:12:18

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

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

JokerBoy wrote:

oh snap..

Sorry about that. I totally skipped your post when checking if anyone posted about this.

Offline

#163 2011-02-25 08:35:10

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

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

Hi folks, does anybody in here have a patch for click-to-focus with click-through, so that the application of the newly focused window also gets the buttonpress event?
It's kind of hard to work with gimp, where I always have to double-click the things in the toolbox... And I don't want to use sloppy focus, because other image windows between the current one and the toolbox will get the foucs, when moving the cursor between those two.

Offline

#164 2011-03-04 04:56:34

Haptic
Member
Registered: 2009-09-03
Posts: 149

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

Offline

#165 2011-03-04 14:08:55

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

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

Haptic wrote:

That patch only gives focus-on-click, no click-through.

Offline

#166 2011-03-04 16:56:37

cf8
Member
From: Russia
Registered: 2008-10-21
Posts: 83

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

ber_t wrote:
Haptic wrote:

That patch only gives focus-on-click, no click-through.

Why cant you use gimp-git? it has a fancy one-window option…

Offline

#167 2011-03-05 16:07:28

ber_t
Member
From: Berlin, Germany
Registered: 2010-03-10
Posts: 214
Website

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

cf8 wrote:

Why cant you use gimp-git? it has a fancy one-window option…

Well, gimp is only the app in which the missing click-through annoys the most and which I therefore used to describe the behaviour...

Offline

#168 2011-03-07 18:16:57

tvale
Member
From: Portugal
Registered: 2008-12-11
Posts: 175

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

simongmzlj wrote:

I'm not interested in getting yet another conversation about how people configuring their dwm or in having yet another thread full of screenshots. I'm starting this thread so people have a channel to share their dwm patches and hacks. Feel free to make requests or ask for help as well with your own endeavors as well.

(...)

opacify
A modified transparency patch. Requires xcompmgr to be running. I changed the transparency level to an int and added functions to allow runtime increasing/decreasing of transparency.
opacify.c = http://github.com/simongmzlj/dwm/blob/master/opacity.c
opacify.diff = http://github.com/simongmzlj/dwm/blob/m … acity.diff

(...)

First of all, kudos for all the work in this thread. You made me switch from XMonad and I have the experience almost perfectly emulated.
Only thing I can't seem to get working is your opacify patch. rxvt-unicode works as expected, but firefox and the likes are just... Invisible. I suppose it works for you, so I may be missing something or applied it wrongly. I'll check in a moment.

Anyway, I also created a repository at github with "my" dwm build. It has a bunch of patches featured here which you can apply in a specific order to a 5.8.2 vanilla dwm. Also a variant of the pidgin layout!

Offline

#169 2011-03-08 04:54:24

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

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

Hey folks, i am having trouble getting nmaster-sym to work.

I am using dwm-5.8.2, and have the following patched applied: pertag-init, bstack, attachaside, focusonclick, cyclelayouts, etc.

I understand that i'll have to manually apply nmaster, due to pertag (and possible others). But looking at nmaster-sym.c, i don't have any idea where to place the code in dwm.c.

Can someone please help me out.

Offline

#170 2011-03-08 05:57:35

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

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

Put the enum with the others, and follow the pattern for the other functions - I put them in alphabetically so it is easier to keep track of them...

Look at the bstack patch and how it works in dwm.c to see how it hangs together.

As long as you have a backup of your successfully patched dwm.c, you really can't go wrong


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#171 2011-03-08 08:17:23

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

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

jasonwryan wrote:

Put the enum with the others, and follow the pattern for the other functions - I put them in alphabetically so it is easier to keep track of them...

Thanks a lot, i managed to get it right after a few tries smile

As long as you have a backup of your successfully patched dwm.c, you really can't go wrong

I always have the backup of the patched dwm.c, modified config.h, as well as the diffs of these made against the vanilla files.

Offline

#172 2011-03-10 02:13:03

tvale
Member
From: Portugal
Registered: 2008-12-11
Posts: 175

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

Lokaltog wrote:

I don't think this qualifies as a patch or a hack, but it's a tip I think some of you may find useful:

I like icons in my statusbar, but I don't want to use a separate app like dzen2 just to show xbm icons when dwm already has a status bar, and I don't know how to patch dwm with xbm support. I've solved this problem by editing my dwm font (I use artwiz cure) and drawing icons in the font itself:

1) If your font is a pcf font, use pcf2bdf (available in AUR) to convert it to a bdf font
2) Install gbdfed (available in AUR) and xorg-font-tools
3) Open your bdf font in gbdfed and replace the glyphs you want with icons. It may be possible to use empty glyphs beyond 0xFF instead, but I haven't tried this.
4) Change the font name if you want (Edit > Font Info > Font Properties), and save the font
5) Use bdftopcf to compile the bdf font to pcf, and gzip it (this step is optional)
6) Copy/move the font to an Xorg font dir, run fc-cache -vf and restart X
7) Insert the symbols in your status bar script or in config.h if you want. I've made some symbols to indicate the layout mode that I use in config.h (see screenshot).

Here's a screenshot of the tip in action (note that I've patched dwm with statuscolors to add some color to the icons):
http://bildr.no/thumb/664213.jpeg

Edit: Check out my GitHub repo for an updated bdf font with various symbols.

Any ideia how to do this in a TTF font?

Offline

#173 2011-03-16 10:15:22

dipilibupap
Member
Registered: 2011-02-05
Posts: 47

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

Hi everyone.. i have a "problem" which is pretty amusing i would say:

I have dzen2 piped with conky in my top bar.

Dzen dissapears when i restart dwm , but when i restart X it appears again. Im guessing that the script in the .xinitrc which makes dwm restart in loop doesnt allow dzen to start again. Is there a solution for this problem? (Im using the startdwm script) in the wiki.


http://dotshare.it    >>    #dotshare@freenode

Offline

#174 2011-03-16 10:18:24

Lokaltog
Member
From: Norway
Registered: 2009-12-04
Posts: 53
Website

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

tvale wrote:

Any ideia how to do this in a TTF font?

I guess you could use FontForge or a similar TTF editor to draw the symbols, but I think it will a lot more difficult to create crisp icons in a TTF font.

Offline

#175 2011-03-16 10:20:56

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

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

dipilibupap this is not the place where you can ask that, but here's what i use:

dwm-start

#!/bin/sh
while :; do
    statusbar > /dev/null 2>&1
    dwm > /dev/null 2>&1
    sleep 2;
done;

statusbar

#!/bin/sh
killall conky dzen2 > /dev/null 2>&1
(sleep 1 && conky | dzen2 -p -e '' -ta r -x '830' -w '850' -h '12' -bg '#1a1918' -fg '#E0E0E0' -fn '-windows-montecarlo-medium-r-normal-*-11-110-72-72-c-60-microsoft-cp1252') > /dev/null 2>&1 &

Offline

Board footer

Powered by FluxBB