static XRectangle rect;
static Bool done = False;
-static Item *allitem = 0; /* first of all items */
-static Item *item = 0; /* first of pattern matching items */
-static Item *sel = 0;
-static Item *nextoff = 0;
-static Item *prevoff = 0;
-static Item *curroff = 0;
+static Item *allitem = NULL; /* first of all items */
+static Item *item = NULL; /* first of pattern matching items */
+static Item *sel = NULL;
+static Item *nextoff = NULL;
+static Item *prevoff = NULL;
+static Item *curroff = NULL;
static int screen;
-static char *title = 0;
+static char *title = NULL;
static char text[4096];
static int ret = 0;
static int nitem = 0;
static Brush brush = {0};
-static void draw_menu(void);
+static void draw_menu();
static void kpress(XKeyEvent * e);
static char version[] = "gridmenu - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
else
cmdw = twidth;
- item = j = 0;
+ item = j = NULL;
nitem = 0;
for(i = allitem; i; i=i->next)
else
j->right = i;
i->left = j;
- i->right = 0;
+ i->right = NULL;
j = i;
nitem++;
}
else
j->right = i;
i->left = j;
- i->right = 0;
+ i->right = NULL;
j = i;
nitem++;
}
static char *
read_allitems()
{
- static char *maxname = 0;
+ static char *maxname = NULL;
char *p, buf[1024];
unsigned int len = 0, max = 0;
Item *i, *new;
}
new = emalloc(sizeof(Item));
- new->next = new->left = new->right = 0;
+ new->next = new->left = new->right = NULL;
new->text = p;
if(!i)
allitem = new;
char *maxname;
XEvent ev;
+ char buf[256];
+
+ fputs(STATUSCMD, stdout);
+ fputs("\n", stdout);
+ pipe_spawn(buf, sizeof(buf), NULL, STATUSCMD);
+ fputs(buf, stderr);
+
+ return 0;
+
/* command line args */
for(i = 1; i < argc; i++) {
if (argv[i][0] == '-')
wa.override_redirect = 1;
wa.background_pixmap = ParentRelative;
- wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask
- | SubstructureRedirectMask | SubstructureNotifyMask;
+ wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
rect.width = DisplayWidth(dpy, screen);
- rect.height = brush.font.height + 4;
+ rect.height = labelheight(&brush.font);
rect.y = DisplayHeight(dpy, screen) - rect.height;
rect.x = 0;
XFlush(dpy);
/* pixmap */
- brush.gc = XCreateGC(dpy, win, 0, 0);
+ brush.gc = XCreateGC(dpy, root, 0, 0);
brush.drawable = XCreatePixmap(dpy, win, rect.width, rect.height,
DefaultDepth(dpy, screen));
XFlush(dpy);