screen: export RandR information

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-09-21 16:33:03 +02:00
parent 8c87b7cb57
commit c08b90345f
2 changed files with 15 additions and 0 deletions

View File

@ -65,6 +65,7 @@ name
ontop ontop
opacity opacity
orientation orientation
outputs
pid pid
release release
resize resize

View File

@ -516,6 +516,20 @@ luaA_screen_index(lua_State *L)
case A_TK_WORKAREA: case A_TK_WORKAREA:
luaA_pusharea(L, screen_area_get(s, true)); luaA_pusharea(L, screen_area_get(s, true));
break; break;
case A_TK_OUTPUTS:
{
lua_createtable(L, 0, s->outputs.len);
foreach(output, s->outputs)
{
lua_createtable(L, 2, 0);
lua_pushinteger(L, output->mm_width);
lua_setfield(L, -2, "mm_width");
lua_pushinteger(L, output->mm_height);
lua_setfield(L, -2, "mm_height");
lua_setfield(L, -2, output->name);
}
}
break;
default: default:
return 0; return 0;
} }