aboutsummaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorConnor Lane Smith <cls@lubutu.com>2010-08-10 18:09:02 +0100
committerConnor Lane Smith <cls@lubutu.com>2010-08-10 18:09:02 +0100
commite149c531b876e666a42870816834723d97a656f4 (patch)
treec65bc85e0e7c9fed244e23353c86afc48dd34f72 /dmenu.c
parent605e9b6c035979935f658c52938df56e2d0387ef (diff)
downloaddmenu-e149c531b876e666a42870816834723d97a656f4.tar.gz
dmenu-e149c531b876e666a42870816834723d97a656f4.tar.bz2
dmenu-e149c531b876e666a42870816834723d97a656f4.zip
more efficient initfont
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/dmenu.c b/dmenu.c
index 8384bc2..a8bdcb9 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -41,6 +41,7 @@ static void usage(void);
static char text[BUFSIZ];
static size_t cursor = 0;
+static const char *font = NULL;
static const char *prompt = NULL;
static const char *normbgcolor = "#cccccc";
static const char *normfgcolor = "#000000";
@@ -501,8 +502,6 @@ main(int argc, char *argv[]) {
int i;
progname = "dmenu";
- dc = initdraw();
-
for(i = 1; i < argc; i++)
/* single flags */
if(!strcmp(argv[i], "-v")) {
@@ -523,7 +522,7 @@ main(int argc, char *argv[]) {
else if(!strcmp(argv[i], "-p"))
prompt = argv[++i];
else if(!strcmp(argv[i], "-fn"))
- initfont(dc, argv[++i]);
+ font = argv[++i];
else if(!strcmp(argv[i], "-nb"))
normbgcolor = argv[++i];
else if(!strcmp(argv[i], "-nf"))
@@ -535,6 +534,8 @@ main(int argc, char *argv[]) {
else
usage();
+ dc = initdraw();
+ initfont(dc, font);
readstdin();
setup();
run();