awful.rules: Add support for screen names
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
2fe9a6dfdf
commit
53bebfde02
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
-- Grab environment we need
|
-- Grab environment we need
|
||||||
local client = client
|
local client = client
|
||||||
|
local screen = screen
|
||||||
local table = table
|
local table = table
|
||||||
local type = type
|
local type = type
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
|
@ -35,6 +36,17 @@ If you want to put Firefox on a specific tag at startup, you can add:
|
||||||
{ rule = { instance = "firefox" },
|
{ rule = { instance = "firefox" },
|
||||||
properties = { tag = mytagobject } }
|
properties = { tag = mytagobject } }
|
||||||
|
|
||||||
|
If you want to put Thunderbird on a specific screen at startup, use:
|
||||||
|
|
||||||
|
{ rule = { instance = "Thunderbird" },
|
||||||
|
properties = { screen = 1 } }
|
||||||
|
|
||||||
|
Assuming that your X11 server supports the RandR extension, you can also specify
|
||||||
|
the screen by name:
|
||||||
|
|
||||||
|
{ rule = { instance = "Thunderbird" },
|
||||||
|
properties = { screen = "VGA1" } }
|
||||||
|
|
||||||
If you want to put Emacs on a specific tag at startup, and immediately switch
|
If you want to put Emacs on a specific tag at startup, and immediately switch
|
||||||
to that tag you can add:
|
to that tag you can add:
|
||||||
|
|
||||||
|
@ -197,7 +209,10 @@ function rules.execute(c, props, callbacks)
|
||||||
if property ~= "focus" and type(value) == "function" then
|
if property ~= "focus" and type(value) == "function" then
|
||||||
value = value(c)
|
value = value(c)
|
||||||
end
|
end
|
||||||
if property == "tag" then
|
if property == "screen" then
|
||||||
|
-- Support specifying screens by name ("VGA1")
|
||||||
|
c.screen = screen[value]
|
||||||
|
elseif property == "tag" then
|
||||||
c.screen = value.screen
|
c.screen = value.screen
|
||||||
c:tags({ value })
|
c:tags({ value })
|
||||||
elseif property == "switchtotag" and value and props.tag then
|
elseif property == "switchtotag" and value and props.tag then
|
||||||
|
|
Loading…
Reference in New Issue