awful.rules: Fix switchtotag with tag names
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
9efc5ca409
commit
fb8c70b07d
|
@ -211,6 +211,7 @@ end
|
||||||
-- @tab props Properties to apply.
|
-- @tab props Properties to apply.
|
||||||
-- @tab[opt] callbacks Callbacks to apply.
|
-- @tab[opt] callbacks Callbacks to apply.
|
||||||
function rules.execute(c, props, callbacks)
|
function rules.execute(c, props, callbacks)
|
||||||
|
local switchtotag = props.switchtotag
|
||||||
for property, value in pairs(props) do
|
for property, value in pairs(props) do
|
||||||
if property ~= "focus" and type(value) == "function" then
|
if property ~= "focus" and type(value) == "function" then
|
||||||
value = value(c)
|
value = value(c)
|
||||||
|
@ -225,14 +226,12 @@ function rules.execute(c, props, callbacks)
|
||||||
end
|
end
|
||||||
c.screen = t.screen
|
c.screen = t.screen
|
||||||
c:tags({ t })
|
c:tags({ t })
|
||||||
elseif property == "switchtotag" and value and props.tag then
|
|
||||||
props.tag:view_only()
|
|
||||||
elseif property == "height" or property == "width" or
|
elseif property == "height" or property == "width" or
|
||||||
property == "x" or property == "y" then
|
property == "x" or property == "y" then
|
||||||
local geo = c:geometry();
|
local geo = c:geometry();
|
||||||
geo[property] = value
|
geo[property] = value
|
||||||
c:geometry(geo);
|
c:geometry(geo);
|
||||||
elseif property == "focus" then
|
elseif property == "focus" or property == "switchtotag" then
|
||||||
-- This will be handled below
|
-- This will be handled below
|
||||||
(function() end)() -- I haven't found a nice way to silence luacheck here
|
(function() end)() -- I haven't found a nice way to silence luacheck here
|
||||||
elseif type(c[property]) == "function" then
|
elseif type(c[property]) == "function" then
|
||||||
|
@ -242,6 +241,11 @@ function rules.execute(c, props, callbacks)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Only do this after the tag has been (possibly) set
|
||||||
|
if switchtotag and c.first_tag then
|
||||||
|
c.first_tag:view_only()
|
||||||
|
end
|
||||||
|
|
||||||
-- Apply all callbacks.
|
-- Apply all callbacks.
|
||||||
if callbacks then
|
if callbacks then
|
||||||
for _, callback in pairs(callbacks) do
|
for _, callback in pairs(callbacks) do
|
||||||
|
|
Loading…
Reference in New Issue