Skip to content

Commit

Permalink
Enhanced naughty notifications from mcabbe.
Browse files Browse the repository at this point in the history
  • Loading branch information
geektophe committed Oct 16, 2013
1 parent 742e707 commit f96506e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion rc/im.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
muc_nick = "chriss"

-- IM settings
naughty.config.presets.online = {
bg = "#1f880e80",
fg = "#ffffff",
Expand Down Expand Up @@ -42,11 +43,19 @@ function mcabber_event_hook(kind, direction, jid, msg)
if direction == "MUC" and txt:match("^<" .. muc_nick .. ">") then
return
end

if jid == "[email protected]" and string.match(mesg, "^PROBLEM:") then
preset = naughty.config.presets.critical
else
preset = naughty.config.presets.normal
end

naughty.notify{
icon = "chat_msg_recv",
text = awful.util.escape(txt),
title = jid,
timeout = 30
timeout = 30,
preset = preset
}
end
-- Disabled connect/disconnect notifications.
Expand Down
6 changes: 5 additions & 1 deletion rc/naughty.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
-- Naughty configuration

naughty.config.defaults = { timeout = 45 }
naughty.config.default_preset = {
timeout = 45,
margin = 4,
gap = 1,
}
naughty.config.icon_dirs = { os.getenv("HOME") .. "/.config/awesome/icons/im/", "/usr/share/pixmaps/" }

-- vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

0 comments on commit f96506e

Please sign in to comment.