mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
screen: add index by output name (FS#361)
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
c08b90345f
commit
9393b2d111
1 changed files with 8 additions and 0 deletions
8
screen.c
8
screen.c
|
@ -442,6 +442,14 @@ luaA_pushscreen(lua_State *L, screen_t *s)
|
|||
static int
|
||||
luaA_screen_module_index(lua_State *L)
|
||||
{
|
||||
const char *name;
|
||||
|
||||
if((name = lua_tostring(L, 2)))
|
||||
foreach(screen, globalconf.screens)
|
||||
foreach(output, screen->outputs)
|
||||
if(!a_strcmp(output->name, name))
|
||||
return luaA_pushscreen(L, screen);
|
||||
|
||||
int screen = luaL_checknumber(L, 2) - 1;
|
||||
luaA_checkscreen(screen);
|
||||
return luaA_pushscreen(L, &globalconf.screens.tab[screen]);
|
||||
|
|
Loading…
Reference in a new issue