cleanup default config
- Add a flag for minimium width on centered dmenu - Change border_width to borderpx for consistency - Wire up additional variables to xresourcsmaster
parent
8e5365c96c
commit
d11991d997
10
config.def.h
10
config.def.h
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */
|
||||||
static int centered = 0; /* -c option; centers dmenu on screen */
|
static int centered = 0; /* -c option; centers dmenu on screen */
|
||||||
static int min_width = 500; /* minimum width when centered */
|
static int min_width = 500; /* -cw option; minimum width when centered */
|
||||||
static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
|
static int fuzzy = 1; /* -F option; if 0, dmenu doesn't use fuzzy matching */
|
||||||
|
|
||||||
/* -fn option overrides fonts[0]; default X11 font or font set */
|
/* -fn option overrides fonts[0]; default X11 font or font set */
|
||||||
|
|
@ -40,7 +40,7 @@ static unsigned int columns = 0;
|
||||||
static const char worddelimiters[] = " ";
|
static const char worddelimiters[] = " ";
|
||||||
|
|
||||||
/* Size of the window border */
|
/* Size of the window border */
|
||||||
static unsigned int border_width = 0;
|
static unsigned int borderpx = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Xresources preferences to load at startup
|
* Xresources preferences to load at startup
|
||||||
|
|
@ -54,4 +54,10 @@ ResourcePref resources[] = {
|
||||||
{ "selbgcolor", STRING, &selbgcolor },
|
{ "selbgcolor", STRING, &selbgcolor },
|
||||||
{ "selhlcolor", STRING, &selhlcolor },
|
{ "selhlcolor", STRING, &selhlcolor },
|
||||||
{ "prompt", STRING, &prompt },
|
{ "prompt", STRING, &prompt },
|
||||||
|
{ "centered", INTEGER, ¢ered },
|
||||||
|
{ "min_width", INTEGER, &min_width },
|
||||||
|
{ "fuzzy", INTEGER, &fuzzy },
|
||||||
|
{ "lines", INTEGER, &lines },
|
||||||
|
{ "columns", INTEGER, &columns },
|
||||||
|
{ "borderpx", INTEGER, &borderpx },
|
||||||
};
|
};
|
||||||
|
|
|
||||||
8
dmenu.c
8
dmenu.c
|
|
@ -953,10 +953,10 @@ setup(void)
|
||||||
swa.override_redirect = True;
|
swa.override_redirect = True;
|
||||||
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
swa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
|
||||||
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
|
swa.event_mask = ExposureMask | KeyPressMask | VisibilityChangeMask;
|
||||||
win = XCreateWindow(dpy, root, x, y, mw, mh, border_width,
|
win = XCreateWindow(dpy, root, x, y, mw, mh, borderpx,
|
||||||
CopyFromParent, CopyFromParent, CopyFromParent,
|
CopyFromParent, CopyFromParent, CopyFromParent,
|
||||||
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
|
CWOverrideRedirect | CWBackPixel | CWEventMask, &swa);
|
||||||
if (border_width)
|
if (borderpx)
|
||||||
XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
|
XSetWindowBorder(dpy, win, scheme[SchemeSel][ColBg].pixel);
|
||||||
XSetClassHint(dpy, win, &ch);
|
XSetClassHint(dpy, win, &ch);
|
||||||
|
|
||||||
|
|
@ -1011,6 +1011,8 @@ main(int argc, char *argv[])
|
||||||
fast = 1;
|
fast = 1;
|
||||||
else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */
|
else if (!strcmp(argv[i], "-c")) /* centers dmenu on screen */
|
||||||
centered = 1;
|
centered = 1;
|
||||||
|
else if (!strcmp(argv[i], "-cw")) /* centered min width on screen */
|
||||||
|
min_width = atoi(argv[++i]);
|
||||||
else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */
|
else if (!strcmp(argv[i], "-F")) /* grabs keyboard before reading stdin */
|
||||||
fuzzy = 0;
|
fuzzy = 0;
|
||||||
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
|
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */
|
||||||
|
|
@ -1050,7 +1052,7 @@ main(int argc, char *argv[])
|
||||||
else if (!strcmp(argv[i], "-w")) /* embedding window id */
|
else if (!strcmp(argv[i], "-w")) /* embedding window id */
|
||||||
embed = argv[++i];
|
embed = argv[++i];
|
||||||
else if (!strcmp(argv[i], "-bw"))
|
else if (!strcmp(argv[i], "-bw"))
|
||||||
border_width = atoi(argv[++i]); /* border width */
|
borderpx = atoi(argv[++i]); /* border width */
|
||||||
else
|
else
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue