diff options
author | Connor Lane Smith <cls@lubutu.com> | 2010-08-10 18:09:02 +0100 |
---|---|---|
committer | Connor Lane Smith <cls@lubutu.com> | 2010-08-10 18:09:02 +0100 |
commit | e149c531b876e666a42870816834723d97a656f4 (patch) | |
tree | c65bc85e0e7c9fed244e23353c86afc48dd34f72 | |
parent | 605e9b6c035979935f658c52938df56e2d0387ef (diff) |
more efficient initfont
-rw-r--r-- | dmenu.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -41,6 +41,7 @@ static void usage(void); | |||
41 | 41 | ||
42 | static char text[BUFSIZ]; | 42 | static char text[BUFSIZ]; |
43 | static size_t cursor = 0; | 43 | static size_t cursor = 0; |
44 | static const char *font = NULL; | ||
44 | static const char *prompt = NULL; | 45 | static const char *prompt = NULL; |
45 | static const char *normbgcolor = "#cccccc"; | 46 | static const char *normbgcolor = "#cccccc"; |
46 | static const char *normfgcolor = "#000000"; | 47 | static const char *normfgcolor = "#000000"; |
@@ -501,8 +502,6 @@ main(int argc, char *argv[]) { | |||
501 | int i; | 502 | int i; |
502 | 503 | ||
503 | progname = "dmenu"; | 504 | progname = "dmenu"; |
504 | dc = initdraw(); | ||
505 | |||
506 | for(i = 1; i < argc; i++) | 505 | for(i = 1; i < argc; i++) |
507 | /* single flags */ | 506 | /* single flags */ |
508 | if(!strcmp(argv[i], "-v")) { | 507 | if(!strcmp(argv[i], "-v")) { |
@@ -523,7 +522,7 @@ main(int argc, char *argv[]) { | |||
523 | else if(!strcmp(argv[i], "-p")) | 522 | else if(!strcmp(argv[i], "-p")) |
524 | prompt = argv[++i]; | 523 | prompt = argv[++i]; |
525 | else if(!strcmp(argv[i], "-fn")) | 524 | else if(!strcmp(argv[i], "-fn")) |
526 | initfont(dc, argv[++i]); | 525 | font = argv[++i]; |
527 | else if(!strcmp(argv[i], "-nb")) | 526 | else if(!strcmp(argv[i], "-nb")) |
528 | normbgcolor = argv[++i]; | 527 | normbgcolor = argv[++i]; |
529 | else if(!strcmp(argv[i], "-nf")) | 528 | else if(!strcmp(argv[i], "-nf")) |
@@ -535,6 +534,8 @@ main(int argc, char *argv[]) { | |||
535 | else | 534 | else |
536 | usage(); | 535 | usage(); |
537 | 536 | ||
537 | dc = initdraw(); | ||
538 | initfont(dc, font); | ||
538 | readstdin(); | 539 | readstdin(); |
539 | setup(); | 540 | setup(); |
540 | run(); | 541 | run(); |