diff options
author | Anselm R Garbe <garbeam@gmail.com> | 2008-06-14 10:55:13 +0100 |
---|---|---|
committer | Anselm R Garbe <garbeam@gmail.com> | 2008-06-14 10:55:13 +0100 |
commit | d2305e4b136b3bdfccf7de897a9f14583a1ca35a (patch) | |
tree | 17750c9adc4530ebb0d1f95d0b5f5f7180e64c25 | |
parent | fcf26a38f1ad291cd794daa52e44af252b728b6a (diff) |
reusing config.h's color values, note we have to use const char *, instead of const char [] here, because the pointer might change
-rw-r--r-- | config.h | 14 | ||||
-rw-r--r-- | dmenu.c | 21 |
2 files changed, 15 insertions, 20 deletions
@@ -1,14 +1,14 @@ | |||
1 | /* See LICENSE file for copyright and license details. */ | 1 | /* See LICENSE file for copyright and license details. */ |
2 | 2 | ||
3 | /* appearance */ | 3 | /* appearance */ |
4 | #define FONT "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*" | 4 | static const char *font = "-*-terminus-medium-r-normal-*-14-*-*-*-*-*-*-*"; |
5 | #define NORMBGCOLOR "#cccccc" | 5 | static const char *normbgcolor = "#cccccc"; |
6 | #define NORMFGCOLOR "#000000" | 6 | static const char *normfgcolor = "#000000"; |
7 | #define SELBGCOLOR "#0066ff" | 7 | static const char *selbgcolor = "#0066ff"; |
8 | #define SELFGCOLOR "#ffffff" | 8 | static const char *selfgcolor = "#ffffff"; |
9 | 9 | ||
10 | static uint spaceitem = 30; /* px between menu items */ | 10 | static uint spaceitem = 30; /* px between menu items */ |
11 | 11 | ||
12 | #ifdef XINERAMA | 12 | #ifdef XINERAMA |
13 | static uint xidx = 0; /* Xinerama screen index to use */ | 13 | static uint xidx = 0; /* Xinerama screen index to use */ |
14 | #endif | 14 | #endif |
@@ -68,13 +68,8 @@ static int textw(const char *text); | |||
68 | #include "config.h" | 68 | #include "config.h" |
69 | 69 | ||
70 | /* variables */ | 70 | /* variables */ |
71 | static char *font = FONT; | ||
72 | static char *maxname = NULL; | 71 | static char *maxname = NULL; |
73 | static char *normbg = NORMBGCOLOR; | ||
74 | static char *normfg = NORMFGCOLOR; | ||
75 | static char *prompt = NULL; | 72 | static char *prompt = NULL; |
76 | static char *selbg = SELBGCOLOR; | ||
77 | static char *selfg = SELFGCOLOR; | ||
78 | static char text[4096]; | 73 | static char text[4096]; |
79 | static int cmdw = 0; | 74 | static int cmdw = 0; |
80 | static int promptw = 0; | 75 | static int promptw = 0; |
@@ -618,10 +613,10 @@ setup(Bool topbar) { | |||
618 | XFreeModifiermap(modmap); | 613 | XFreeModifiermap(modmap); |
619 | 614 | ||
620 | /* style */ | 615 | /* style */ |
621 | dc.norm[ColBG] = getcolor(normbg); | 616 | dc.norm[ColBG] = getcolor(normbgcolor); |
622 | dc.norm[ColFG] = getcolor(normfg); | 617 | dc.norm[ColFG] = getcolor(normfgcolor); |
623 | dc.sel[ColBG] = getcolor(selbg); | 618 | dc.sel[ColBG] = getcolor(selbgcolor); |
624 | dc.sel[ColFG] = getcolor(selfg); | 619 | dc.sel[ColFG] = getcolor(selfgcolor); |
625 | initfont(font); | 620 | initfont(font); |
626 | 621 | ||
627 | /* menu window */ | 622 | /* menu window */ |
@@ -704,19 +699,19 @@ main(int argc, char *argv[]) { | |||
704 | if(++i < argc) font = argv[i]; | 699 | if(++i < argc) font = argv[i]; |
705 | } | 700 | } |
706 | else if(!strcmp(argv[i], "-nb")) { | 701 | else if(!strcmp(argv[i], "-nb")) { |
707 | if(++i < argc) normbg = argv[i]; | 702 | if(++i < argc) normbgcolor = argv[i]; |
708 | } | 703 | } |
709 | else if(!strcmp(argv[i], "-nf")) { | 704 | else if(!strcmp(argv[i], "-nf")) { |
710 | if(++i < argc) normfg = argv[i]; | 705 | if(++i < argc) normfgcolor = argv[i]; |
711 | } | 706 | } |
712 | else if(!strcmp(argv[i], "-p")) { | 707 | else if(!strcmp(argv[i], "-p")) { |
713 | if(++i < argc) prompt = argv[i]; | 708 | if(++i < argc) prompt = argv[i]; |
714 | } | 709 | } |
715 | else if(!strcmp(argv[i], "-sb")) { | 710 | else if(!strcmp(argv[i], "-sb")) { |
716 | if(++i < argc) selbg = argv[i]; | 711 | if(++i < argc) selbgcolor = argv[i]; |
717 | } | 712 | } |
718 | else if(!strcmp(argv[i], "-sf")) { | 713 | else if(!strcmp(argv[i], "-sf")) { |
719 | if(++i < argc) selfg = argv[i]; | 714 | if(++i < argc) selfgcolor = argv[i]; |
720 | } | 715 | } |
721 | else if(!strcmp(argv[i], "-v")) | 716 | else if(!strcmp(argv[i], "-v")) |
722 | eprint("dmenu-"VERSION", © 2006-2008 dmenu engineers, see LICENSE for details\n"); | 717 | eprint("dmenu-"VERSION", © 2006-2008 dmenu engineers, see LICENSE for details\n"); |