You are not logged in.

#601 2012-02-11 06:19:07

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

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

steve_ wrote:

On a sidenote, I think the default keybindings for 'view' and 'toggleview' in dwm are backwards.  I can't believe this is how it's intended to be (and I've been using dwm for 4+ years!).  Pulling tags in and sending them out is far more useful than going to one, separate tag.  Switching these bindings makes dwm much more enjoyable, IMO.

jasonwryan wrote:

Agreed. If toggleview pulled the tag to master by default, it would be even better...

fd wrote:

Also, it emphatizes more that tags are not workspaces (unless pertag)

Would you guys (or anyone else) care to elaborate? I've read the article about tags not being workspaces but I'm still not quite getting it all. I'm kind dense. I've always used the tags as workspaces but I'd like to learn how to use it as it was intended and see what I'm missing. I just starting using pertag2, but does this mean that I shouldn't? It seems that a lot of people use it. Are you guys using the tags as workspaces? I feel like Vinnie Barbarino from Welcome Back Kotter (I'm so confused!) HALP!

edit: in the meantime, I'll do a little reading and experimenting. Any further reading suggestions? Thanks

Last edited by stlarch (2012-02-11 08:26:16)

Offline

#602 2012-02-11 07:00:16

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

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

Heh. I went through exactly the same thing just a little while back: the thought of patching pertag-init against dwm-6 forced me to think about why I was using it like a static window manager when it is designed explicitly as a dynamic one.

I just reversed my workflow: set up my usual tags and work from the first. I then pull in a browser, or mail client etc., as I need them. I feel I am only just scratching the surface and I would be keen to hear how other dwm users set up their workflow.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#603 2012-02-11 08:33:06

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

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

Ok, I'm starting to get it. Wow. It's kinda blowin my mind right now. I'm going to have to reevaluate how I use it. Reversing the view and toggleview are messing with me at the moment. But then again, I'm probably a little drunk. I'll mess with it more tomorrow. Yeah, the possibilities are mind boggling!

btw, does anyone know of a just a bstack patch for 6.0

Last edited by stlarch (2012-02-11 08:39:12)

Offline

#604 2012-02-11 09:47:25

ivoarch
Member
Registered: 2011-03-31
Posts: 436

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

@Stlarch 

stlarch wrote:

Ok, I'm starting to get it. Wow. It's kinda blowin my mind right now. I'm going to have to reevaluate how I use it. Reversing  But then again, I'm probably a little drunk. I'll mess with it more tomorrow. Yeah, the possibilities are mind boggling!

btw, does anyone know of a just a bstack patch for 6.0

dwm-6.0-bstack.diff https://gist.github.com/1798312

Closed for hangover smile

Last edited by ivoarch (2012-02-11 13:55:38)


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

Offline

#605 2012-02-11 12:26:43

ibrunton
Member
From: Canada
Registered: 2011-05-05
Posts: 270

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

I find there are some things I want to do tiled and some things I want floating, so I like the pertag approach and using tags as workspaces, myself, even if that's not how they're intended.

Has anyone made or found a useless-gaps patch for version 6 yet?

Offline

#606 2012-02-11 13:32:47

ivoarch
Member
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

#607 2012-02-11 16:13:36

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

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

stlarch wrote:

Would you guys (or anyone else) care to elaborate?

edit: in the meantime, I'll do a little reading and experimenting. Any further reading suggestions? Thanks

This[1] might help.

I generally put each program on it's own tag, then pull in/send out what
I need/don't need.

Tag 1 is my main terminal running tmux on my local host.
Tag 2 is another terminal I use to log into other machines I have to
administer.  I use this[2]  script that I call 'go'
to log into those machines, ie 'ctrl-b d; go HOSTNAME'
Tag 3 is firefox w/pentadactyl[3]
Tag 4 is mutt
Tag 5 is weechat
Tag 6 for is vm/pair programming
Tag 8 is rtorrent
Tag 9 is usually the pdf I'm reading before bed.

Currently I use no patches.  I make heavy use of MOD+Tab. Usually on one
'view' I will have tags 1,2,3 and on the other I have 8,4,5.


[1] http://lubutu.com/rant/dwm-faq
[2] http://sprunge.us/JeCI
[3] On an unrelated note, for years I've used a clunky js plugin to try
and toggle the bg colours of wepages, ie from default to a dark bg.  It
worked ok but had warts. Earlier this week I found out about
:styletoggle   Now one can add this to their ~/.pentadactylrc

style -name=dark http*  <<EOM

* { background-color:#121212 !important; color: #AFAFAF !important; background-image:none !important; border-color: #585858 !important;  }
a { color: #5F87AF !important; text-decoration: none !important; }
a:visited { color: #956D9D !important; text-decoration: none !important; }
input, textarea { -moz-appearance: none !important; background: #585858 !important; color:#121212 !important; }

EOM

The keybinding to toggle is (I use F2):

:map -ex <F2> :styletoggle -name dark

To get the hint colours to work I added '!important' to my colour scheme
file:

hi Hint             color:#DADADA !important;   background:#9E5641 !important; z-index:5000; font:normal 8pt sans-serif; padding:0px 1px 0px 1px;position:absolute
hi HintActive       color:#121212;              background:none !important
hi Hint[active]     color:#121212 !important;   background:#DADADA !important
hi HintElem         color:#121212;              background:none !important

Last edited by steve___ (2012-02-11 16:15:58)

Offline

#608 2012-02-11 18:46:21

bohoomil
Member
Registered: 2010-09-04
Posts: 2,376
Website

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

[A side comment:]

When I started playing with dwm, I couldn't grasp the idea of tags vs workspaces at all because I was thinking of the former through the functionality of the latter. However, when I tried to adapt to tags not being a different form of workspaces, but more a dynamic rearrangement of a single desktop on which the same elements can be used in different functional combinations, I realized it was a pretty clever and efficient approach.


:: Registered Linux User No. 223384

:: github
:: infinality-bundle+fonts: good looking fonts made easy

Offline

#609 2012-02-11 18:52:24

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

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

Thanks ivoarch for the bstack patch. And thanks for some hints guys. I'm thinking a little clearer and understand it now. I think it's primarily for tiling mode. I'm mostly in monocle mode on my netbook so it might not be best for this setup but I can start to see it's potential. I need a bigger screen now. I've been meaning to get another one but have been procrastinating. Now I have a reason.

I probably don't use mine like most of you guys but I'd like to learn more. I've heard some people say that it doesn't work well on a netbook, but I find to be superior even in my limited use of it. This little wonder of a wm never ceases to amaze me. I take back all the curses I've screamed at you (you diabolical bastards!) dwm and suckless. You rock. I'm using monsterwm and snapwm too, which have pertag so I'll just keep using them like I have for now and experiment with dwm. Sounds like a plan.

Offline

#610 2012-02-12 01:01:30

fd
Member
Registered: 2011-05-27
Posts: 10

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

stlarch wrote:

Would you guys (or anyone else) care to elaborate?

I usually have 2 windows at master column, and a bit of increased mfact and mhfact (see my patch tongue), and pull there every window that I'm using (Firefox, Minecraft, Terminals, etc), and have some Pidgin windows around. If I want to hide something, I can toggle that tag (web|term|game|chat|etc), and it works pretty cool to me.

Offline

#611 2012-02-12 07:46:18

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

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

ivoarch wrote:
stlarch wrote:

btw, does anyone know of a just a bstack patch for 6.0

dwm-6.0-bstack.diff https://gist.github.com/1798312

Closed for hangover smile

https://gist.github.com/1807116

This is for 6.0..

Last edited by JokerBoy (2012-02-12 07:46:40)

Offline

#612 2012-02-12 09:54:23

ivoarch
Member
Registered: 2011-03-31
Posts: 436

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

@bogdan

Ok,thanks
I updated the patch, now whit nmaster.


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

Offline

#613 2012-02-12 17:47:51

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

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

HeHe. I feel like I'm learning how to use dwm all over (again!).

@thanks for the updated bstack JokerBoy and ivoarch

Offline

#614 2012-02-14 10:05:07

devil_kc
Member
Registered: 2008-09-14
Posts: 93

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

i was using awesome for many years now. anrxc created scratchpad for awesome, this is i guess xmonad feature.

i really miss this in dwm. i have seen scratchpad in some of yours config.h's. i tried to build dwm to support scratchpad but no luck.

could you post me a step by step guide to create urxvtc scratchpad in dwm?

i guess that scratchpad would be like in awesome - on key combo scratchpad is shown on any tag, and with the same key combo it is "pushed" to the background/ hidden..

thanks!

Offline

#615 2012-02-14 11:38:42

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

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

scratchpad for 6.0 fixed for multi-monitor setup you can find at http://hg.punctweb.ro/dwm/src

Offline

#616 2012-02-14 12:46:54

devil_kc
Member
Registered: 2008-09-14
Posts: 93

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

works like a charm, thanks!

Offline

#617 2012-02-16 13:01:17

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Hello,

I'm busy setting up my first DWM environment, since WMFS is deprecated soon and I have always wanted to try it anyway. I have some little issues (for example, I can't figure out how to set up my own font in the statusbar) but I decided to try patching DWM already, just for the fun of it. For aestatic reasons I want to use uselessgaps so I grabbed the original patch for dwm-5.9 and applied it. It's working clean and good, but the stacked (correct term?) windows on the right when in Tiling layout, don't have gaps in between them, like so:

tY3R1aA

Since I'm all new at this, this might be a very noobish thing to ask, but how can I modify this patch so that I get gaps there too?

Last edited by Unia (2012-02-16 13:01:51)


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

#618 2012-02-16 13:12:27

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

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

Unia wrote:

Since I'm all new at this, this might be a very noobish thing to ask, but how can I modify this patch so that I get gaps there too?

There's three methods on page 24, which is one page behind this...


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

Offline

#619 2012-02-16 13:25:26

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Meyithi wrote:
Unia wrote:

Since I'm all new at this, this might be a very noobish thing to ask, but how can I modify this patch so that I get gaps there too?

There's three methods on page 24, which is one page behind this...

I know but those all require other patches, right? I only want to use uselessgaps for now, not the others (such as bstack). The one you linked to disables nmaster, which is something I'd like to keep if possible. I did read those, but AFAIK (which ain't much) they don't do what I want.

Sorry if I misunderstand things, though.

Last edited by Unia (2012-02-16 13:26:24)


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

#620 2012-02-16 13:45:05

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

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

Unia wrote:
Meyithi wrote:
Unia wrote:

Since I'm all new at this, this might be a very noobish thing to ask, but how can I modify this patch so that I get gaps there too?

There's three methods on page 24, which is one page behind this...

I know but those all require other patches, right? I only want to use uselessgaps for now, not the others (such as bstack). The one you linked to disables nmaster, which is something I'd like to keep if possible. I did read those, but AFAIK (which ain't much) they don't do what I want.

Sorry if I misunderstand things, though.

Read this one again, https://bbs.archlinux.org/viewtopic.php … 8#p1050418, especially the quoted bit.  That patch works fine but the gaps are a bit inconsistent (like how most other tilers handle it, double gaps between vertical clients).


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

Offline

#621 2012-02-16 13:50:40

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Meyithi wrote:

Read this one again, https://bbs.archlinux.org/viewtopic.php … 8#p1050418, especially the quoted bit.  That patch works fine but the gaps are a bit inconsistent (like how most other tilers handle it, double gaps between vertical clients).

Thanks, I'll try this then!

EDIT: For the moment, this is good enough. Thanks again Meyithi!

Last edited by Unia (2012-02-16 13:58:53)


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

#622 2012-02-18 13:34:16

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Oke I have some more questions. I'm can't read C (yet), but I'm trying - and I'm also extensively using patches for the first time. Slowly getting there to understand though, but now I do need some help.

I have to manually patch dwm.c, because as you know applying patch B after patch A sometimes fails. I'm still 'practicing' this but I want to know that once I manually patch patch B in, can I create a diff of only patch B and not patch A? I want to do this because if I ever have to start over again I still have all my patches, instead of manually patch them every time.

Second this is that I'm trying to get the systray patch to work, but I get these errors:

dwm.c: In functie ‘systray_acquire’:
dwm.c:2217:30: fout: ‘DC’ has no member named ‘norm’
dwm.c:2219:63: fout: ‘DC’ has no member named ‘norm’
make: *** [dwm.o] Fout 1
==> ERROR: A failure occurred in build().
    Aborting...

The patch applies succesfull, though.


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

#623 2012-02-18 14:43:05

ivoarch
Member
Registered: 2011-03-31
Posts: 436

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

@Unia
Are using statuscolors.patch?


you have to change in your dwm.c these Línies

// Init traywin window
+	wattr.event_mask        = ButtonPressMask | ExposureMask;
+	wattr.override_redirect = True;
+	wattr.background_pixmap = ParentRelative;
+	wattr.background_pixel  = dc.norm[ColBG]; 

to this

// Init traywin window
+	wattr.event_mask        = ButtonPressMask | ExposureMask;
+	wattr.override_redirect = True;
+	wattr.background_pixmap = ParentRelative;
+	wattr.background_pixel  = dc.colors[0][ColBG]; 

and the same  with

traywin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, dc.norm[ColBG]);

 

to this

traywin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, dc.colors[0][ColBG]); 

Last edited by ivoarch (2012-02-18 14:47:46)


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

Offline

#624 2012-02-18 14:56:16

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Yep, I am. I applied those fixes in the patch and now it builds succesfull!

Thanks!


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

#625 2012-02-18 21:20:35

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

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

Sorry for spamming this thread once again, if my questions are too noobish just tell me and I'll try learning some C first or just accept to live without some patches for now. (however I have just edited a patch to apply it over an already patched dwm.c, so I am learning, albeit coming from a very, very low level)

I have applied Meyithi's uselessgaps patch which removes nmaster (and also includes statuscolors), since I found myself never using nmaster anyway. I now want to apply bstack patch, but it still has the nmaster function in it. I looked at Meyithi's patch to see how it removed nmaster and tried applying it on bstack (bstack only swaps w/h and x/y, right?), but it failed and all I could see of my windows was just the top. So now I'm asking if you could explain to me how I do it. For relevance, here's the current/original bstack patch and the part of Meyithi's patch I used:

diff -paur dwm-6.0/dwm.c dwm-6.0.new/dwm.c
--- src/dwm-6.0/dwm.c	2012-02-08 22:20:06.021349113 +0100
+++ src/dwm-6.0/dwm.c	2012-02-08 22:23:25.213603330 +0100
@@ -162,6 +162,7 @@ static void arrange(Monitor *m);
 static void arrangemon(Monitor *m);
 static void attach(Client *c);
 static void attachstack(Client *c);
+static void bstack(Monitor *m);
 static void buttonpress(XEvent *e);
 static void checkotherwm(void);
 static void cleanup(void);
@@ -2128,6 +2129,32 @@ zoom(const Arg *arg) {
 	pop(c);
 }
 
+void
+bstack(Monitor *m) {
+	unsigned int i, n, w, mh, mx, tx;
+	Client *c;
+
+	for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+	if(n == 0)
+		return;
+
+	if(n > m->nmaster)
+		mh = m->nmaster ? m->wh * m->mfact : 0;
+	else
+		mh = m->wh;
+	for(i = mx = tx = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+		if(i < m->nmaster) {
+			w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
+			resize(c, m->wx + mx, m->wy, w - (2*c->bw), mh - (2*c->bw), False);
+			mx += WIDTH(c);
+		}
+		else {
+			w = (m->ww - tx) / (n - i);
+			resize(c, m->wx + tx, m->wy + mh, w - (2*c->bw), m->wh - mh - (2*c->bw), False);
+			tx += WIDTH(c);
+		}
+}
+
 int
 main(int argc, char *argv[]) {
 	if(argc == 2 && !strcmp("-v", argv[1]))
-
-	if(n > m->nmaster)
-		mw = m->nmaster ? m->ww * m->mfact : 0;
-	else
-		mw = m->ww;
-	for(i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
-		if(i < m->nmaster) {
-			h = (m->wh - my) / (MIN(n, m->nmaster) - i);
-			resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), False);
-			my += HEIGHT(c);
-		}
-		else {
-			h = (m->wh - ty) / (n - i);
-			resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), False);
-			ty += HEIGHT(c);
-		}
+	/* master */
+	c = nexttiled(m->clients);
+	mw = m->mfact * m->ww;
+	resize(c, m->wx, m->wy, (n == 1 ? m->ww : mw) - 2 * c->bw, m->wh - 2 * c->bw, False);
+	if(--n == 0)
+		return;
+	/* tile stack */
+	x = (m->wx + mw > c->x + c->w) ? c->x + c->w + 2 * c->bw : m->wx + mw;
+	y = m->wy;
+	w = (m->wx + mw > c->x + c->w) ? m->wx + m->ww - x : m->ww - mw;
+	h = m->wh / n;
+	if(h < bh)
+		h = m->wh;
+	for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+		resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
+		       ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
+		if(h != m->wh)
+			y = c->y + HEIGHT(c);

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

Board footer

Powered by FluxBB