2013-04-13 15:17:09 +00:00
|
|
|
local rules = { mt={} }
|
|
|
|
local awful = awful
|
|
|
|
local conf = conf
|
|
|
|
local tags = tags
|
|
|
|
local beautiful = beautiful
|
|
|
|
local inspect=require("inspect")
|
2010-06-06 02:56:07 +00:00
|
|
|
|
2013-04-13 15:17:09 +00:00
|
|
|
local rule_screen = conf.rule_screen or 1
|
|
|
|
|
2014-01-21 12:22:22 +00:00
|
|
|
local function popup_urgent(message)
|
|
|
|
return function(client)
|
|
|
|
client:connect_signal("property::urgent", function (c)
|
|
|
|
if c.urgent and not c.focus then
|
|
|
|
naughty.notify({ text=message })
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-04-13 15:17:09 +00:00
|
|
|
local function setup(self)
|
|
|
|
awful.rules.rules = {
|
|
|
|
-- All clients will match this rule.
|
|
|
|
{
|
|
|
|
rule = { },
|
|
|
|
properties = {
|
|
|
|
border_width = beautiful.border_width,
|
|
|
|
border_color = beautiful.border_normal,
|
|
|
|
focus = true,
|
|
|
|
size_hints_honor = false,
|
|
|
|
keys = clientkeys,
|
|
|
|
minimized = false,
|
|
|
|
--skip_taskbar = true,
|
|
|
|
buttons = clientbuttons
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Passprompt" },
|
|
|
|
properties = { ontop = true, focus = true}
|
|
|
|
},
|
2014-01-21 12:22:42 +00:00
|
|
|
{
|
|
|
|
rule = { class = "Sm" },
|
|
|
|
properties = {
|
|
|
|
ontop = true,
|
|
|
|
border_width = 0
|
|
|
|
}
|
|
|
|
},
|
2013-04-13 15:17:09 +00:00
|
|
|
{
|
|
|
|
rule_any = { class = {
|
|
|
|
"pinentry", "Passprompt", "MPlayer"
|
|
|
|
}},
|
|
|
|
properties = { floating = true, size_hints_honor = true }
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
rule = { class = "Firefox", instance = "Navigator" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][2],
|
|
|
|
floating = false, minimized = false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule_any = { class = {"Pidgin"}, instance = {"Weechat"} },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][3], opacity = 0.9
|
2014-01-21 12:22:22 +00:00
|
|
|
},
|
|
|
|
callback = popup_urgent("new chat message")
|
2013-04-13 15:17:09 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { role = "buddy_list" },
|
|
|
|
properties = {
|
|
|
|
master = true
|
|
|
|
}
|
|
|
|
},
|
2014-01-21 12:22:42 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
rule = { class = "Steam", name = "Friends" },
|
|
|
|
properties = {
|
|
|
|
master = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2013-04-13 15:17:09 +00:00
|
|
|
{
|
|
|
|
rule_any = { role ={ "conversation" }, instance = { "Weechat" } },
|
|
|
|
callback = awful.client.setslave
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Irssi"},
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][3]
|
|
|
|
} ,
|
|
|
|
callback = awful.client.setslave
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Claws-mail" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][4]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { instance = "Gmutt" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][4]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { instance = "Gcanto" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][5]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { instance = "Gncmpcpp" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][6]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Gmpc" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][6]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Deluge" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][7]
|
|
|
|
}
|
|
|
|
},
|
2014-01-21 12:22:42 +00:00
|
|
|
{
|
|
|
|
rule = { class = "Pdfpc" },
|
|
|
|
properties = {
|
|
|
|
size_hints_honor = true,
|
|
|
|
float = true,
|
|
|
|
fullscreen = true
|
|
|
|
}
|
|
|
|
},
|
2013-04-13 15:17:09 +00:00
|
|
|
{
|
|
|
|
rule = { class = "Cellwriter" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][1],
|
|
|
|
ontop = true,
|
|
|
|
size_hints_honor = true,
|
|
|
|
float = true,
|
|
|
|
sticky = true,
|
|
|
|
fullscreen = true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Xhtop" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][22]
|
|
|
|
}
|
|
|
|
},
|
2014-01-21 12:22:42 +00:00
|
|
|
{
|
|
|
|
rule = { class = "Dmenu" },
|
|
|
|
properties = {
|
|
|
|
opacity = 0.8
|
|
|
|
}
|
|
|
|
},
|
2013-04-13 15:17:09 +00:00
|
|
|
{
|
|
|
|
rule = { class = "URxvt" },
|
|
|
|
properties = {
|
|
|
|
opacity = 0.9
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "Gvim" },
|
|
|
|
properties = {
|
|
|
|
opacity = 0.9
|
|
|
|
}
|
|
|
|
},
|
2013-05-01 22:25:52 +00:00
|
|
|
{
|
|
|
|
rule = { class = "feh", name = "timetable" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][13],
|
|
|
|
skip_taskbar = true,
|
|
|
|
type = desktop,
|
|
|
|
focusable = false,
|
2014-01-21 12:22:42 +00:00
|
|
|
border_width = 0
|
2013-05-01 22:25:52 +00:00
|
|
|
}
|
|
|
|
},
|
2013-04-13 15:17:09 +00:00
|
|
|
{
|
|
|
|
rule = { instance = "Awesomelog" },
|
|
|
|
properties = {
|
|
|
|
tag = tags[rule_screen][14]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
rule = { class = "GLSlideshow" },
|
|
|
|
properties = {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
rules.setup = setup
|
|
|
|
|
|
|
|
rules.mt.__call = setup
|
|
|
|
|
|
|
|
return setmetatable(rules, rules.mt)
|