You are not logged in.
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
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
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.
The statuscolor approach is, in my opinion, really poor.
ᶘ ᵒᴥᵒᶅ
Offline
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);
Arch64/DWM || My Dropbox referral link
Offline
with this you can use your mouse also..
...............
Thanks, i don't use the mouse. But i'm sure someone will find it useful
Offline
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.
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.
Offline
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.
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
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.
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
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
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..
Arch64/DWM || My Dropbox referral link
Offline
oh snap..
Sorry about that. I totally skipped your post when checking if anyone posted about this.
Offline
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
On DWM's website:
http://dwm.suckless.org/patches/focusonclick
Offline
On DWM's website:
http://dwm.suckless.org/patches/focusonclick
That patch only gives focus-on-click, no click-through.
Offline
Haptic wrote:On DWM's website:
http://dwm.suckless.org/patches/focusonclickThat patch only gives focus-on-click, no click-through.
Why cant you use gimp-git? it has a fancy one-window option…
Offline
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
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
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
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
Offline
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
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
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.jpegEdit: Check out my GitHub repo for an updated bdf font with various symbols.
Any ideia how to do this in a TTF font?
Offline
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
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
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 &
Arch64/DWM || My Dropbox referral link
Offline