awesomewm/rules.lua

230 lines
4.4 KiB
Lua
Raw Normal View History

2013-04-13 15:17:09 +00:00
local rules = { mt={} }
2014-08-28 08:58:03 +00:00
local awful = require("awful")
2013-04-13 15:17:09 +00:00
local tags = tags
2014-08-28 08:58:03 +00:00
local beautiful = require("beautiful")
local binder = binder or require("separable.binder")
2010-06-06 02:56:07 +00:00
2014-08-28 08:58:03 +00:00
local rule_screen = 1
2013-04-13 15:17:09 +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,
2014-08-28 08:56:49 +00:00
focus = awful.client.focus.filter,
raise = true,
2013-04-13 15:17:09 +00:00
minimized = false,
size_hints_honor = false,
keys = binder.client.keys(),
buttons = binder.client.buttons(),
},
2014-08-28 08:56:49 +00:00
-- print name and class of new windows for debugging purposes
callback = function(c)
print("-----------\nnew client\n")
if (c["name"] ~= nil) then
print("name: " .. c["name"])
end
if (c["class"] ~= nil) then
print("class: " .. c["class"])
end
end
2013-04-13 15:17:09 +00:00
},
{
rule = { class = "Passprompt" },
properties = { ontop = true, focus = true}
},
2014-01-21 12:22:42 +00:00
{
rule = { class = "Sm" },
properties = {
2016-07-25 13:07:53 +00:00
floating = true,
size_hints_honor = true,
-- --ontop = true,
fullscreen = true,
2016-07-25 13:07:53 +00:00
-- border_width = 0
2014-01-21 12:22:42 +00:00
}
},
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],
2015-08-02 13:24:30 +00:00
floating = false, minimized = false
2015-05-15 19:06:07 +00:00
},
},
2013-04-13 15:17:09 +00:00
{
rule_any = { class = {"Pidgin"}, instance = {"Weechat"} },
properties = {
tag = tags[rule_screen][3], opacity = 0.8
},
callback = popup_urgent("new chat message")
2013-04-13 15:17:09 +00:00
},
{
rule = { role = "buddy_list" },
2016-04-04 13:03:40 +00:00
callback = awful.client.setmaster
2013-04-13 15:17:09 +00:00
},
2014-01-21 12:22:42 +00:00
{
rule = { class = "Steam", name = "Friends" },
properties = {
tag = tags[rule_screen][3],
2015-08-02 13:23:32 +00:00
},
callback = awful.client.setmaster
},
{
rule = { class = "Steam", name = "Chat" },
properties = {
tag = tags[rule_screen][3],
},
2015-05-15 19:06:07 +00:00
callback = awful.client.setslave
},
2015-05-24 21:51:54 +00:00
{
rule = { class = "Steam", name = "Steam" },
properties = {
tag = tags[rule_screen][11],
}
},
2015-05-15 19:06:07 +00:00
{
rule = { class = "Telegram" },
properties = {
tag = tags[rule_screen][3],
},
callback = awful.client.setslave
},
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 = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][4]
2013-04-13 15:17:09 +00:00
}
},
{
rule = { instance = "Gmutt" },
properties = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][4]
2013-04-13 15:17:09 +00:00
}
},
{
rule = { instance = "Gcanto" },
properties = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][5]
2013-04-13 15:17:09 +00:00
}
},
{
rule = { instance = "Gncmpcpp" },
properties = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][6]
2013-04-13 15:17:09 +00:00
}
},
{
rule = { class = "Gmpc" },
properties = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][6]
2013-04-13 15:17:09 +00:00
}
},
{
rule = { class = "Deluge" },
properties = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][7]
2013-04-13 15:17:09 +00:00
}
},
2014-01-21 12:22:42 +00:00
{
rule = { class = "Pdfpc" },
properties = {
size_hints_honor = true,
float = true,
2015-08-02 13:24:30 +00:00
fullscreen = true
2014-01-21 12:22:42 +00:00
}
},
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,
2015-08-02 13:24:30 +00:00
fullscreen = true
2013-04-13 15:17:09 +00:00
}
},
{
rule = { class = "Xhtop" },
properties = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][22]
2013-04-13 15:17:09 +00:00
}
},
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.8
2013-04-13 15:17:09 +00:00
}
},
{
rule = { class = "Gvim" },
properties = {
opacity = 0.8
2013-04-13 15:17:09 +00:00
}
},
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 = {
2015-08-02 13:24:30 +00:00
tag = tags[rule_screen][14]
2013-04-13 15:17:09 +00:00
}
},
{
rule = { class = "GLSlideshow" },
properties = {
2015-08-02 13:24:30 +00:00
2013-04-13 15:17:09 +00:00
}
}
}
end
rules.setup = setup
rules.mt.__call = setup
return setmetatable(rules, rules.mt)