Skip to content

Instantly share code, notes, and snippets.

@blueyed
Created February 11, 2015 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blueyed/ffe106027f44420be6a3 to your computer and use it in GitHub Desktop.
Save blueyed/ffe106027f44420be6a3 to your computer and use it in GitHub Desktop.
focus = function(c)
-- if c.startup_id and snid_props_cb[c.startup_id] then
-- -- Do not focus (yet).
-- return false
-- end
local r
if not awful.client.focus.filter(c) then
r = false
elseif c.type ~= "normal" and c.transient_for then
-- Only restrict windows with parents!
if awful.client.istransientfor(c, client.focus) then
r = c
else
if not awesome.startup then
c.urgent = true
end
r = false
end
else
r = c
end
-- local tb = debug.traceback()
-- bdebug({c=c, c_name = c.name or "no name", skip_taskbar = c.skip_taskbar, hidden = c.hidden,
-- c_type = c.type, c_focusable = tostring(c.focusable), c_transient_for = tostring(c.transient_for),
-- client_focus=tostring(client.focus), tb = tb, r=r and true or r,
-- }, 'rules: focus?')
return r
end,
-- -- DEFAULT:
-- focus = awful.client.focus.filter,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment