rules: fix error on missing display
This commit is contained in:
parent
f944a3766c
commit
baf62150e1
22
rules.lua
22
rules.lua
|
@ -17,13 +17,11 @@ end
|
||||||
if not localconf.screen then
|
if not localconf.screen then
|
||||||
localconf.screen = {}
|
localconf.screen = {}
|
||||||
end
|
end
|
||||||
local screen_main = localconf.screen.main or 1
|
local screen_main = math.min(localconf.screen.main or 1, screen.count())
|
||||||
local screen_chat = localconf.screen.chat or screen.count()
|
local screen_chat = math.min(localconf.screen.chat or screen.count(), screen.count())
|
||||||
local screen_mail = localconf.screen.mail or screen.count()
|
local screen_mail = math.min(localconf.screen.mail or screen.count(), screen.count())
|
||||||
print("Screens: main: ".. screen_main .. ", chat: ".. screen_chat .. ", mail: " .. screen_mail)
|
print("Screens: main: ".. screen_main .. ", chat: ".. screen_chat .. ", mail: " .. screen_mail)
|
||||||
|
|
||||||
screen2 = screen:count() > 1 and 2 or 1
|
|
||||||
|
|
||||||
awful.rules.rules = {
|
awful.rules.rules = {
|
||||||
-- All clients will match this rule.
|
-- All clients will match this rule.
|
||||||
{
|
{
|
||||||
|
@ -106,13 +104,6 @@ awful.rules.rules = {
|
||||||
floating = false
|
floating = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
rule = { class = "Eclipse", name = nil, type = "dialog" },
|
|
||||||
properties = {
|
|
||||||
screen = screen2, tag = "8",
|
|
||||||
floating = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
rule = { class = "Eclipse", name = ".*", type = "dialog" },
|
rule = { class = "Eclipse", name = ".*", type = "dialog" },
|
||||||
properties = {
|
properties = {
|
||||||
|
@ -148,11 +139,18 @@ awful.rules.rules = {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
rule = { class = "Telegram" },
|
rule = { class = "Telegram" },
|
||||||
|
except = { name = "Media viewer" },
|
||||||
properties = {
|
properties = {
|
||||||
screen = screen_chat, tag = "3"
|
screen = screen_chat, tag = "3"
|
||||||
},
|
},
|
||||||
callback = awful.client.setslave
|
callback = awful.client.setslave
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
rule = { class = "Telegram", name = "Media viewer" },
|
||||||
|
properties = {
|
||||||
|
fullscreen = true
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
rule_any = { role ={ "conversation" }, instance = { "Weechat" } },
|
rule_any = { role ={ "conversation" }, instance = { "Weechat" } },
|
||||||
callback = awful.client.setslave
|
callback = awful.client.setslave
|
||||||
|
|
Loading…
Reference in a new issue