ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I decided to rewrite this out and use this thread for a reference as well as a place to receive any help/guidance (If anyone wishes to) while making modifications to dwm.
bstack.c (Jul. 17. 09)
Code:
void
bstack(Monitor *m) {
int x, y, h, w, mh;
unsigned int i, n;
Client *c;
for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if(n == 0)
return;
c = nexttiled(m->clients);
mh = m->mfact * m->wh;
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False);
if(--n == 0) return;
x = m->wx;
y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh;
w = m->ww / n;
h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh;
if(h < bh)
h = m->wh;
for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
resize(c, x, y, ((i + 1 == n) ? m->wx + m->ww - x : w) - 2 * c->bw,
h - 2 * c->bw, False);
if(w != m->ww)
x = c->x + WIDTH(c);
}
}
P.S. I am writing this here for many reasons, the main reason is I have a bad habit of learning the wrong methods for doing a lot of things (regardless how many times I read books, etc) and since I am learning this all on my own, well, some helpful hints/reading/etc would be...well...helpful...
Anyway, if no one likes that I am doing this, just say so and I will ask a moderator to delete the thread. If you don't mind it, then thanks, ...
Last edited by Mol_Bolom; 07-27-2009 at 09:35 PM.
Reason: Changing my method for learning C.
And inside drawbar() I added settime(); right after the initialization of variables. So that whenever the bar is redrawn, the time will be displayed where dwm-5.6 would have normally been displayed. I don't really have a need to keep track of time down to the second, and since opening and closing a window is as simple as a few key presses, it seems to be more appropriate to change the time that way rather than adding extra code that serves no purpose, IMO.
The last thing I changed is I commented out strcpy() and removed the if statement.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.