diff --git a/awesomerc.lua.in b/awesomerc.lua.in index 938777fc..f2b7c33b 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -172,6 +172,10 @@ end -- Hook function to execute when a new client appears. function hook_newclient(c) c:focus_set() + local name = c:name_get() + if name:find("mplayer") then + c:floating_set(true) + end end -- Set up some hooks diff --git a/client.c b/client.c index 24a68d3e..42059c9e 100644 --- a/client.c +++ b/client.c @@ -1093,6 +1093,14 @@ luaA_client_icon_set(lua_State *L) return 0; } +static int +luaA_client_name_get(lua_State *L) +{ + client_t **c = luaL_checkudata(L, 1, "client"); + lua_pushstring(L, (*c)->name); + return 1; +} + const struct luaL_reg awesome_client_methods[] = { { "get", luaA_client_get }, @@ -1103,6 +1111,7 @@ const struct luaL_reg awesome_client_methods[] = }; const struct luaL_reg awesome_client_meta[] = { + { "name_get", luaA_client_name_get }, { "titlebar_set", luaA_client_titlebar_set }, { "screen_set", luaA_client_screen_set }, { "screen_get", luaA_client_screen_get },