sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 243dfa43e38897d1eae0e2c93b216173a6c87af1
parent f986eb9345213b8c405daa5786589473c4681308
Author: Andrew Milkovich <amilkovich@gmail.com>
Date:   Wed, 23 Jan 2013 11:37:50 -0800

dualstatus patch added

Diffstat:
Adwm.suckless.org/patches/dualstatus.md | 24++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-6.1-dualstatus.diff | 192+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adwm.suckless.org/patches/dwm-dualstatus.png | 0
Msuckless.org/people/more_people.md | 1+
4 files changed, 217 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/dualstatus.md b/dwm.suckless.org/patches/dualstatus.md @@ -0,0 +1,24 @@ +dualstatus +========== + +Description +----------- +This patch will enable both a top and bottom status bar in dwm. The bottom bar can be toggled along with the top bar or independently. + +The status bar text can be set as follows: +xsetroot -name "Top textBOTTOM=Bottom text" + +Download +-------- + + * [dwm-6.1-dualstatus.diff](dwm-6.1-dualstatus.diff) (5793b) (20130123) + +Screenshot +---------- + +a simple dual status bar +![alt text](dwm-dualstatus.png) + +Authors +------- + * Andrew Milkovich - `<amilkovich at gmail dot com>` diff --git a/dwm.suckless.org/patches/dwm-6.1-dualstatus.diff b/dwm.suckless.org/patches/dwm-6.1-dualstatus.diff @@ -0,0 +1,192 @@ +diff --git a/config.def.h b/config.def.h +index 8fd5d4a..6daa608 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -12,6 +12,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ + static const unsigned int snap = 32; /* snap pixel */ + static const Bool showbar = True; /* False means no bar */ + static const Bool topbar = True; /* False means bottom bar */ ++static const Bool bottombar = True; /* True means an extra bar at the bottom */ + + /* tagging */ + static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; +@@ -58,6 +59,7 @@ static Key keys[] = { + { MODKEY, XK_p, spawn, {.v = dmenucmd } }, + { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, + { MODKEY, XK_b, togglebar, {0} }, ++ { MODKEY, XK_b, togglebottombar,{0} }, + { MODKEY, XK_j, focusstack, {.i = +1 } }, + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, +diff --git a/dwm.c b/dwm.c +index d9443da..0d358ca 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -131,6 +131,7 @@ struct Monitor { + int nmaster; + int num; + int by; /* bar geometry */ ++ int bby; /* bottom bar geometry */ + int mx, my, mw, mh; /* screen size */ + int wx, wy, ww, wh; /* window area */ + unsigned int seltags; +@@ -138,11 +139,14 @@ struct Monitor { + unsigned int tagset[2]; + Bool showbar; + Bool topbar; ++ Bool showbottombar; ++ Bool bottombar; + Client *clients; + Client *sel; + Client *stack; + Monitor *next; + Window barwin; ++ Window bbarwin; + const Layout *lt[2]; + }; + +@@ -229,6 +233,7 @@ static void tagmon(const Arg *arg); + static int textnw(const char *text, unsigned int len); + static void tile(Monitor *); + static void togglebar(const Arg *arg); ++static void togglebottombar(const Arg *arg); + static void togglefloating(const Arg *arg); + static void toggletag(const Arg *arg); + static void toggleview(const Arg *arg); +@@ -256,6 +261,7 @@ static void zoom(const Arg *arg); + /* variables */ + static const char broken[] = "broken"; + static char stext[256]; ++static char btext[256]; + static int screen; + static int sw, sh; /* X display screen geometry width, height */ + static int bh, blw = 0; /* bar geometry */ +@@ -515,6 +521,8 @@ cleanupmon(Monitor *mon) { + } + XUnmapWindow(dpy, mon->barwin); + XDestroyWindow(dpy, mon->barwin); ++ XUnmapWindow(dpy, mon->bbarwin); ++ XDestroyWindow(dpy, mon->bbarwin); + free(mon); + } + +@@ -585,8 +593,10 @@ configurenotify(XEvent *e) { + XFreePixmap(dpy, dc.drawable); + dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); + updatebars(); +- for(m = mons; m; m = m->next) ++ for(m = mons; m; m = m->next) { + XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); ++ XMoveResizeWindow(dpy, m->bbarwin, m->wx, m->bby, m->ww, bh); ++ } + focus(NULL); + arrange(NULL); + } +@@ -657,6 +667,8 @@ createmon(void) { + m->nmaster = nmaster; + m->showbar = showbar; + m->topbar = topbar; ++ m->bottombar = bottombar; ++ m->showbottombar = bottombar ? True : False; + m->lt[0] = &layouts[0]; + m->lt[1] = &layouts[1 % LENGTH(layouts)]; + strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); +@@ -755,6 +767,15 @@ drawbar(Monitor *m) { + drawtext(NULL, dc.norm, False); + } + XCopyArea(dpy, dc.drawable, m->barwin, dc.gc, 0, 0, m->ww, bh, 0, 0); ++ if(m->showbottombar) { ++ dc.x = 0; ++ dc.w = TEXTW(btext); ++ drawtext(btext, dc.norm, False); ++ dc.x += dc.w; ++ dc.w = m->ww - dc.x; ++ drawtext(NULL, dc.norm, False); ++ XCopyArea(dpy, dc.drawable, m->bbarwin, dc.gc, 0, 0, m->ww, bh, 0, 0); ++ } + XSync(dpy, False); + } + +@@ -1745,6 +1766,14 @@ togglebar(const Arg *arg) { + } + + void ++togglebottombar(const Arg *arg) { ++ selmon->showbottombar = !selmon->showbottombar; ++ updatebarpos(selmon); ++ XMoveResizeWindow(dpy, selmon->bbarwin, selmon->wx, selmon->bby, selmon->ww, bh); ++ arrange(selmon); ++} ++ ++void + togglefloating(const Arg *arg) { + if(!selmon->sel) + return; +@@ -1848,6 +1877,13 @@ updatebars(void) { + CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); + XDefineCursor(dpy, m->barwin, cursor[CurNormal]); + XMapRaised(dpy, m->barwin); ++ if (m->bottombar) { ++ m->bbarwin = XCreateWindow(dpy, root, m->wx, m->bby, m->ww, bh, 0, DefaultDepth(dpy, screen), ++ CopyFromParent, DefaultVisual(dpy, screen), ++ CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); ++ XDefineCursor(dpy, m->bbarwin, cursor[CurNormal]); ++ XMapRaised(dpy, m->bbarwin); ++ } + } + } + +@@ -1862,6 +1898,12 @@ updatebarpos(Monitor *m) { + } + else + m->by = -bh; ++ if (m->showbottombar) { ++ m->wh -= bh; ++ m->bby = m->wy + m->wh; ++ } ++ else ++ m->bby = -bh; + } + + void +@@ -2034,8 +2076,39 @@ updatetitle(Client *c) { + + void + updatestatus(void) { +- if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext))) ++ char buftext[512]; ++ if(!gettextprop(root, XA_WM_NAME, buftext, sizeof(buftext))) + strcpy(stext, "dwm-"VERSION); ++ else { ++ char* blocation = strstr(buftext,"BOTTOM="); ++ if (blocation != NULL) { ++ int c = 0; ++ for (char* i = buftext; i < blocation; i++) { ++ if (c < sizeof(stext) - 1) ++ stext[c] = *i; ++ else ++ break; ++ c++; ++ } ++ stext[c] = '\0'; ++ blocation += 7; ++ c = 0; ++ for (char* i = blocation; i < (blocation + sizeof(buftext)); i++) ++ { ++ if (c < sizeof(btext) - 1) ++ btext[c] = *i; ++ else ++ break; ++ c++; ++ } ++ btext[c] = '\0'; ++ } ++ else { ++ for (int i = 0; i < sizeof(stext); i++) ++ stext[i] = buftext[i]; ++ stext[sizeof(stext) - 1] = '\0'; ++ } ++ } + drawbar(selmon); + } + diff --git a/dwm.suckless.org/patches/dwm-dualstatus.png b/dwm.suckless.org/patches/dwm-dualstatus.png Binary files differ. diff --git a/suckless.org/people/more_people.md b/suckless.org/people/more_people.md @@ -5,6 +5,7 @@ The following people are/were involved mainly in wmii and dwm development as developers and contributors. If you are missing, feel free to add yourself. * Alexandre DE DOMMELIN (contributed a theme and works on PHP based theme configurator) +* Andrew Milkovich (patches, updates) * [Anthony Martin](http://pbrane.org) (ality) (developer, bug fixes, documentation) * AntThyKem (contributed rpm package) * Bernhard Leiner (wmipager improvements)