Lines 1-23
Link Here
|
1 |
--- lib/awful/rules.lua.in |
1 |
--- lib/awful/rules.lua.in |
2 |
+++ lib/awful/rules.lua.in |
2 |
+++ lib/awful/rules.lua.in |
3 |
@@ -89,7 +89,9 @@ end |
3 |
@@ -112,7 +112,7 @@ function apply(c) |
4 |
|
4 |
if property == "floating" then |
5 |
--- Apply rules to a client. |
5 |
aclient.floating.set(c, value) |
6 |
-- @param c The client. |
6 |
elseif property == "tag" then |
7 |
-function apply(c) |
7 |
- aclient.movetotag(value, c) |
8 |
+-- @param startup Executed at startup ? (optional, default is false) |
8 |
+ c:tags({ value }) |
9 |
+function apply(c, startup) |
9 |
elseif property == "switchtotag" and value and props.tag then |
10 |
+ startup = startup or false |
10 |
atag.viewonly(props.tag) |
11 |
local props = {} |
11 |
elseif property == "height" or property == "width" or |
12 |
local callbacks = {} |
12 |
@@ -127,6 +127,11 @@ function apply(c) |
13 |
for _, entry in ipairs(rules) do |
13 |
end |
14 |
@@ -129,6 +131,9 @@ function apply(c) |
|
|
15 |
callback(c) |
16 |
end |
14 |
end |
17 |
|
15 |
|
18 |
+ -- Apply tags. |
16 |
+ -- If untagged, stick the client on the current one. |
19 |
+ atag.withcurrent(c, startup) |
17 |
+ if #c:tags() == 0 then |
|
|
18 |
+ atag.withcurrent(c, startup) |
19 |
+ end |
20 |
+ |
20 |
+ |
21 |
-- Do this at last so we do not erase things done by the focus |
21 |
-- Apply all callbacks from matched rules. |
22 |
-- signal. |
22 |
for i, callback in pairs(callbacks) do |
23 |
if props.focus then |
23 |
callback(c) |
|
|
24 |
@@ -140,5 +145,6 @@ function apply(c) |
25 |
end |
26 |
|
27 |
client.add_signal("manage", apply) |
28 |
+client.remove_signal("manage", atag.withcurrent) |
29 |
|
30 |
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 |