summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-10-26 21:16:00 +0200
committerAnton Khirnov <anton@khirnov.net>2021-10-26 21:16:00 +0200
commitfc297a92ca20d8697d503ff8f409a57803dbea43 (patch)
tree603ebedeb31d45038a29126130561e0455e71c0f
parent430a4f0d47f0066c0112534844741c7a4e9141f5 (diff)
rc: use singleton notification helper
-rw-r--r--rc.lua17
1 files changed, 7 insertions, 10 deletions
diff --git a/rc.lua b/rc.lua
index 96f3b22..0a8a4f1 100644
--- a/rc.lua
+++ b/rc.lua
@@ -12,6 +12,7 @@ local naughty = require("naughty")
local bindings = require("bindings")
local commondefs = require("commondefs")
local pager = require("pager")
+local utils = require("utils")
local workspace = require("workspace")
-- {{{ Error handling
@@ -193,20 +194,16 @@ client.connect_signal("mouse::enter",
-- show a notification on changing tag properties
do
local tag_prop_notify = {
- master_count = {},
- column_count = {},
- master_width_factor = {},
+ master_count = 'Master count',
+ column_count = 'Column count',
+ master_width_factor = 'Master width factor',
}
- for name, tbl in pairs(tag_prop_notify) do
+ for name, desc in pairs(tag_prop_notify) do
tag.connect_signal('property::' .. name,
function(tag)
- local args = { title = name, text = tostring(tag[name]), timeout = 2 }
- if tbl.notification and tbl.notification.box.visible then
- args.replaces_id = tbl.notification.id
- end
-
- tbl.notification = naughty.notify(args)
+ utils.notify_singleton(wsp, name,
+ { title = desc, text = tostring(tag[name]), timeout = 2 })
end)
end
end