1
Index: docker-1.4/docker.c
2
===================================================================
3
--- docker-1.4.orig/docker.c
4
+++ docker-1.4/docker.c
5
@@ -24,6 +24,7 @@ int width = 0, height = 0;
6
int border = 1; /* blank area around icons. must be > 0 */
7
gboolean horizontal = TRUE; /* layout direction */
8
int icon_size = 24; /* width and height of systray icons */
9
+static const char *colortext = NULL;
11
static char *display_string = NULL;
12
/* excluding the border. sum of all child apps */
13
@@ -95,6 +96,15 @@ void parse_cmd_line()
14
g_printerr("-iconsize requires a parameter\n");
17
+ } else if (0 == strcasecmp(argv[i], "-color")) {
21
+ colortext = argv[i];
22
+ } else { /* argument doesn't exist */
23
+ g_printerr("-color requires a parameter\n");
27
if (argv[i][0] == '-')
29
@@ -121,6 +131,9 @@ void parse_cmd_line()
30
g_print(" -iconsize SIZE The size (width and height) to display\n"
31
" icons as in the system tray. Defaults to\n"
33
+ g_print(" -color COLOR The background color to use for the tray.\n"
34
+ " Defaults to whatever color the window\n"
35
+ " manager specifies.\n");
39
@@ -154,6 +167,9 @@ void create_main_window()
45
+ char *name = "Docker";
47
/* the border must be > 0 if not in wmaker mode */
48
assert(wmaker || border > 0);
49
@@ -167,7 +183,6 @@ void create_main_window()
53
- char *name = "Docker";
54
XStringListToTextProperty(&name, 1, &text);
55
XSetWMName(display, win, &text);
57
@@ -178,7 +193,19 @@ void create_main_window()
60
XSync(display, False);
61
- XSetWindowBackgroundPixmap(display, win, ParentRelative);
64
+ colormap = DefaultColormap(display, DefaultScreen(display));
65
+ if (!XParseColor(display, colormap, colortext, &xcolor)) {
66
+ g_printerr("Couldn't find color in database: %s\n", colortext);
69
+ assert(XAllocColor(display, colormap, &xcolor));
70
+ XSetWindowBackground(display, win, xcolor.pixel);
72
+ XSetWindowBackgroundPixmap(display, win, ParentRelative);
75
XClearWindow(display, win);