From ddc159f57eca14e8f9a6e07d73391dfe504cf583 Mon Sep 17 00:00:00 2001 From: Cedric GESTES Date: Thu, 27 Aug 2009 12:43:00 +0200 Subject: [PATCH] rules: add a switchtotag rule to select the tag after setting it for a client Signed-off-by: Cedric GESTES Signed-off-by: Julien Danjou --- lib/awful/rules.lua.in | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/awful/rules.lua.in b/lib/awful/rules.lua.in index 0591c25c..ac4b0180 100644 --- a/lib/awful/rules.lua.in +++ b/lib/awful/rules.lua.in @@ -10,6 +10,7 @@ local type = type local ipairs = ipairs local pairs = pairs local aclient = require("awful.client") +local atag = require("awful.tag") --- Apply rules to clients at startup. module("awful.rules") @@ -24,17 +25,28 @@ module("awful.rules") -- --

--

If you want to set mplayer floating at startup, you can add: --- --
+-- -- { rule = { name = "MPlayer" }, -- properties = { floating = true } } -- --

--

If you want to put Firefox on a specific tag at startup, you -- can add: --- +-- +-- { rule = { instance = "firefox" } -- properties = { tag = mytagobject } } +-- +--

+--

If you want to put Emacs on a specific tag at startup, and +-- immediately switch to that tag you can add: +--
+-- +-- { rule = { class = "Emacs" } +-- properties = { tag = mytagobject, switchtotag = true } } +-- +--

--

Note that all "rule" entries need to match. If any of the entry does not -- match, the rule won't be applied.

--

If a client matches multiple rules, their applied in the order they are @@ -74,6 +86,9 @@ function apply(c) aclient.floating.set(c, value) elseif property == "tag" then aclient.movetotag(value, c) + elseif property == "switchtotag" and value + and entry.properties["tag"] then + atag.viewonly(entry.properties["tag"]) elseif type(c[property]) == "function" then c[property](c, value) else -- 2.11.4.GIT