[lua] Add colors_set() function
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
81a1531f7a
commit
f76357499c
|
@ -3,6 +3,11 @@
|
||||||
-- Include awesome library, with lots of useful function!
|
-- Include awesome library, with lots of useful function!
|
||||||
require("awful")
|
require("awful")
|
||||||
|
|
||||||
|
-- {{{ Colors and fonts
|
||||||
|
awesome.font_set("sans 8")
|
||||||
|
awesome.colors_set({ fg = "white", bg = "black" })
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Variables definitions
|
-- {{{ Variables definitions
|
||||||
-- This is used later as the default terminal to run.
|
-- This is used later as the default terminal to run.
|
||||||
terminal = "xterm"
|
terminal = "xterm"
|
||||||
|
|
15
lua.c
15
lua.c
|
@ -291,6 +291,20 @@ luaA_font_set(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
luaA_colors_set(lua_State *L)
|
||||||
|
{
|
||||||
|
const char *fg, *bg;
|
||||||
|
luaA_checktable(L, 1);
|
||||||
|
if((fg = luaA_getopt_string(L, 1, "fg", NULL)))
|
||||||
|
draw_color_new(globalconf.connection, globalconf.default_screen,
|
||||||
|
fg, &globalconf.colors.fg);
|
||||||
|
if((bg = luaA_getopt_string(L, 1, "bg",NULL)))
|
||||||
|
draw_color_new(globalconf.connection, globalconf.default_screen,
|
||||||
|
bg, &globalconf.colors.bg);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
luaA_parserc(const char *rcfile)
|
luaA_parserc(const char *rcfile)
|
||||||
{
|
{
|
||||||
|
@ -311,6 +325,7 @@ luaA_parserc(const char *rcfile)
|
||||||
{ "mouse", luaA_mouse },
|
{ "mouse", luaA_mouse },
|
||||||
{ "resizehints_set", luaA_resizehints_set },
|
{ "resizehints_set", luaA_resizehints_set },
|
||||||
{ "font_set", luaA_font_set },
|
{ "font_set", luaA_font_set },
|
||||||
|
{ "colors_set", luaA_colors_set },
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
static const struct luaL_reg awesome_hooks_lib[] =
|
static const struct luaL_reg awesome_hooks_lib[] =
|
||||||
|
|
Loading…
Reference in New Issue