JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
another command gets workspace env
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index d8e2402..8cc9571 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -55,7 +55,8 @@
 #define WIDTH(X)                ((X)->w + 2 * (X)->bw)
 #define HEIGHT(X)               ((X)->h + 2 * (X)->bw)
 #define TAGMASK                 ((1 << LENGTH(tags)) - 1)
-#define TEXTW(X)                (drw_font_getexts_width(drw->font, X, strlen(X)) + drw->font->h)
+#define TEXTW_NOPAD(X)          drw_font_getexts_width(drw->font, X, strlen(X))
+#define TEXTW(X)                (TEXTW_NOPAD(X) + drw->font->h)
 
 /* enums */
 enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@@ -241,13 +242,13 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
 static int xerrorstart(Display *dpy, XErrorEvent *ee);
 static void zoom(const Arg *arg);
 
-/* variables */
+// variables
 static Bool key_buffering = False;
 static const char broken[] = "broken";
 static char stext[256];
 static int screen;
-static int sw, sh;           /* X display screen geometry width, height */
-static int bh, blw = 0;      /* bar geometry */
+static int sw, sh;  // X display screen geometry width, height
+static int bh;      // bar height
 static int (*xerrorxlib)(Display *, XErrorEvent *);
 static unsigned int numlockmask = 0;
 static void (*handler[LASTEvent]) (XEvent *) = {
@@ -804,11 +805,9 @@ drawbar(Monitor *m) {
        }
        x = 0;
        for(i = 0; i < LENGTH(tags); i++) {
-               w = TEXTW(tags[i]);
+               w = TEXTW_NOPAD(tags[i]);
                drw_setscheme(drw, m->tagset[m->seltags] & 1 << i ? &scheme[SchemeSel] : &scheme[SchemeNorm]);
-               drw_text(drw, x, 0, w, bh, tags[i], urg & 1 << i);
-               drw_rect(drw, x, 0, w, bh, m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
-                          occ & 1 << i, urg & 1 << i);
+               drw_text_nopad(drw, x, 0, w, bh, tags[i], urg & 1 << i);
                x += w;
        }
        xx = x;
@@ -1746,7 +1745,7 @@ kbspawn(const Arg *arg) {
 void
 spawn(const Arg *arg) {
        int tag = 0, i;
-       if(arg->v == termcmd || arg->v == runcmd) {
+       if(arg->v == termcmd || arg->v == belltermcmd || arg->v == runcmd) {
                for(i = 0; i < 32; ++i) {
                        if(selmon->tagset[selmon->seltags] & (1 << i)) {
                                tag = i;