Remove globalconf.colors
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
ebcda492a1
commit
6826e5dfc4
18
awesome.c
18
awesome.c
|
@ -303,8 +303,7 @@ int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *confpath = NULL;
|
char *confpath = NULL;
|
||||||
int xfd, i, opt, colors_nbr;
|
int xfd, i, opt;
|
||||||
xcolor_init_request_t colors_reqs[2];
|
|
||||||
ssize_t cmdlen = 1;
|
ssize_t cmdlen = 1;
|
||||||
xdgHandle xdg;
|
xdgHandle xdg;
|
||||||
bool no_argb = false;
|
bool no_argb = false;
|
||||||
|
@ -484,18 +483,9 @@ main(int argc, char **argv)
|
||||||
/* init screens information */
|
/* init screens information */
|
||||||
screen_scan();
|
screen_scan();
|
||||||
|
|
||||||
/* init default font and colors */
|
/* init default font */
|
||||||
colors_reqs[0] = xcolor_init_unchecked(&globalconf.colors.fg,
|
|
||||||
"#000000", sizeof("#000000") - 1);
|
|
||||||
|
|
||||||
colors_reqs[1] = xcolor_init_unchecked(&globalconf.colors.bg,
|
|
||||||
"#ffffff", sizeof("#ffffff") - 1);
|
|
||||||
|
|
||||||
globalconf.font = font_new("sans 8");
|
globalconf.font = font_new("sans 8");
|
||||||
|
|
||||||
for(colors_nbr = 0; colors_nbr < 2; colors_nbr++)
|
|
||||||
xcolor_init_reply(colors_reqs[colors_nbr]);
|
|
||||||
|
|
||||||
xutil_lock_mask_get(globalconf.connection, xmapping_cookie,
|
xutil_lock_mask_get(globalconf.connection, xmapping_cookie,
|
||||||
globalconf.keysyms, &globalconf.numlockmask,
|
globalconf.keysyms, &globalconf.numlockmask,
|
||||||
&globalconf.shiftlockmask, &globalconf.capslockmask,
|
&globalconf.shiftlockmask, &globalconf.capslockmask,
|
||||||
|
@ -519,8 +509,8 @@ main(int argc, char **argv)
|
||||||
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_COLORMAP,
|
XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_COLORMAP,
|
||||||
(const uint32_t [])
|
(const uint32_t [])
|
||||||
{
|
{
|
||||||
globalconf.colors.bg.pixel,
|
globalconf.screen->black_pixel,
|
||||||
globalconf.colors.bg.pixel,
|
globalconf.screen->black_pixel,
|
||||||
globalconf.default_cmap
|
globalconf.default_cmap
|
||||||
});
|
});
|
||||||
xcb_create_gc(globalconf.connection, globalconf.gc, tmp_win, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND,
|
xcb_create_gc(globalconf.connection, globalconf.gc, tmp_win, XCB_GC_FOREGROUND | XCB_GC_BACKGROUND,
|
||||||
|
|
|
@ -75,11 +75,6 @@ typedef struct
|
||||||
client_array_t stack;
|
client_array_t stack;
|
||||||
/** Lua VM state */
|
/** Lua VM state */
|
||||||
lua_State *L;
|
lua_State *L;
|
||||||
/** Default colors */
|
|
||||||
struct
|
|
||||||
{
|
|
||||||
xcolor_t fg, bg;
|
|
||||||
} colors;
|
|
||||||
/** Default font */
|
/** Default font */
|
||||||
font_t *font;
|
font_t *font;
|
||||||
/** The event loop */
|
/** The event loop */
|
||||||
|
|
16
luaa.c
16
luaa.c
|
@ -400,10 +400,6 @@ luaA_awesome_index(lua_State *L)
|
||||||
lua_pushnumber(L, globalconf.font->height);
|
lua_pushnumber(L, globalconf.font->height);
|
||||||
else if(a_strcmp(buf, "conffile") == 0)
|
else if(a_strcmp(buf, "conffile") == 0)
|
||||||
lua_pushstring(L, conffile);
|
lua_pushstring(L, conffile);
|
||||||
else if(a_strcmp(buf, "fg") == 0)
|
|
||||||
luaA_pushxcolor(L, globalconf.colors.fg);
|
|
||||||
else if(a_strcmp(buf, "bg") == 0)
|
|
||||||
luaA_pushxcolor(L, globalconf.colors.bg);
|
|
||||||
else if(a_strcmp(buf, "version") == 0)
|
else if(a_strcmp(buf, "version") == 0)
|
||||||
lua_pushliteral(L, AWESOME_VERSION);
|
lua_pushliteral(L, AWESOME_VERSION);
|
||||||
else if(a_strcmp(buf, "release") == 0)
|
else if(a_strcmp(buf, "release") == 0)
|
||||||
|
@ -432,18 +428,6 @@ luaA_awesome_newindex(lua_State *L)
|
||||||
font_delete(&globalconf.font);
|
font_delete(&globalconf.font);
|
||||||
globalconf.font = font_new(newfont);
|
globalconf.font = font_new(newfont);
|
||||||
}
|
}
|
||||||
else if(a_strcmp(buf, "fg") == 0)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
if((buf = luaL_checklstring(L, 3, &len)))
|
|
||||||
xcolor_init_reply(xcolor_init_unchecked(&globalconf.colors.fg, buf, len));
|
|
||||||
}
|
|
||||||
else if(a_strcmp(buf, "bg") == 0)
|
|
||||||
{
|
|
||||||
size_t len;
|
|
||||||
if((buf = luaL_checklstring(L, 3, &len)))
|
|
||||||
xcolor_init_reply(xcolor_init_unchecked(&globalconf.colors.bg, buf, len));
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -435,8 +435,8 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t *wgeom, bool startup)
|
||||||
| XCB_CW_COLORMAP,
|
| XCB_CW_COLORMAP,
|
||||||
(const uint32_t [])
|
(const uint32_t [])
|
||||||
{
|
{
|
||||||
globalconf.colors.bg.pixel,
|
globalconf.screen->black_pixel,
|
||||||
globalconf.colors.bg.pixel,
|
globalconf.screen->black_pixel,
|
||||||
XCB_GRAVITY_NORTH_WEST,
|
XCB_GRAVITY_NORTH_WEST,
|
||||||
XCB_GRAVITY_NORTH_WEST,
|
XCB_GRAVITY_NORTH_WEST,
|
||||||
1,
|
1,
|
||||||
|
|
Loading…
Reference in New Issue