From 8869cd570ca13d23aa0db37c830eae1fd820538b Mon Sep 17 00:00:00 2001 From: cuu Date: Sun, 21 Oct 2018 11:57:27 +0800 Subject: [PATCH 1/2] awesome config --- awesome/rc.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index d056081..a817219 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -81,6 +81,11 @@ awful.layout.layouts = { -- }}} -- {{{ Helper functions + +local function tableHasKey(table,key) + return table[key] ~= nil +end + local function client_menu_toggle_fn() local instance = nil @@ -464,14 +469,18 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n client.disconnect_signal("request::activate", awful.ewmh.activate) function awful.ewmh.activate(c) + if tableHasKey(c,"class") == false then + return + end + if c:isvisible() then if c.class:lower() ~= "gsnotify-arm" then client.focus = c end - if c.class:lower() == "retroarch" then - c:lower() - end + if c.class:lower() == "retroarch" then + c:lower() + end end end From d175b5a1bad4f2a4dcd5436b9691cc7f2783ff8a Mon Sep 17 00:00:00 2001 From: cuu Date: Sun, 21 Oct 2018 12:07:32 +0800 Subject: [PATCH 2/2] awesome config,missing class in table --- awesome/rc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/awesome/rc.lua b/awesome/rc.lua index a817219..887c956 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -377,7 +377,7 @@ client.connect_signal("manage", function (c) c.below=true c.fullscreen=false - if c.class:lower() == "gsnotify-arm" then + if tableHasKey(c,"class") and c.class:lower() == "gsnotify-arm" then -- naughty.notify({text = "launched!",timeout = 2,position = "top_center"}) c.ontop = true c.above = true @@ -390,7 +390,7 @@ client.connect_signal("manage", function (c) for s in capi.screen do if s.geometry.width > 320 then for _,v in pairs(gs_class) do - if c.class:lower() == v then + if tableHasKey(c,"class") and c.class:lower() == v then awful.titlebar.hide(c) if v ~= "gsnotify-arm" then awful.placement.centered(c)