From 79c0a95ecba9ac338091949b83768db66846d64d Mon Sep 17 00:00:00 2001 From: crater2150 Date: Tue, 21 Jan 2014 13:22:22 +0100 Subject: [PATCH] Add popup callback for client rules, e.g. popup when chat client becomes urgent --- rules.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rules.lua b/rules.lua index 4f50dac..5e69796 100644 --- a/rules.lua +++ b/rules.lua @@ -7,6 +7,16 @@ local inspect=require("inspect") local rule_screen = conf.rule_screen or 1 +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 + local function setup(self) awful.rules.rules = { -- All clients will match this rule. @@ -45,7 +55,8 @@ local function setup(self) rule_any = { class = {"Pidgin"}, instance = {"Weechat"} }, properties = { tag = tags[rule_screen][3], opacity = 0.9 - } + }, + callback = popup_urgent("new chat message") }, { rule = { role = "buddy_list" },