-
Notifications
You must be signed in to change notification settings - Fork 1
/
yeahlaunch.h
46 lines (38 loc) · 1.07 KB
/
yeahlaunch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __YEAHLAUNCH_H
#define __YEAHLAUNCH_H
#include <X11/Xlib.h>
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
#define DRAW_LABEL(i, gc) { if ((tabs[i].label != NULL) && tabs[i].label[0]) { \
XDrawString(dpy, tabs[i].win, (gc), 3, height - 4, tabs[i].label, strlen(tabs[i].label)); \
} }
#define SAFE_FREE(x) { if ((x) != NULL) free(x); }
#define RCFILE ".yeahlaunchrc"
#define DEF_STEP 3
#define DEF_SEP_WIDTH 32
#define DEF_PADDING 6
#define DEF_FONT "fixed"
#define DEF_FG "white"
#define DEF_AFG "yellow"
#define DEF_BG "blue"
struct tab {
char *label;
char *cmd;
int x, width;
Window win;
};
struct config {
char *fn; /* config file */
char *fontname;
char *fg;
char *afg;
char *bg;
unsigned int step;
/* A negative drawdir is the X interpretation of a negative geometry. A
positive drawdir is normal, and zero means center the tabs on the screen. */
int drawdir;
unsigned int x;
};
#define yeah_perror(s, a...) fprintf(stderr, __FILE__ "%s: %d: " s ": %s", __func__, __LINE__, a, strerror(errno));
#endif