From 7d64cce93bee8af0ef017ae5b56d9e5b5499d4f7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 13 Jun 2021 13:53:27 +0200 Subject: rc: notify on new values of tag properties --- rc.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rc.lua b/rc.lua index 23702d9..b0809ea 100644 --- a/rc.lua +++ b/rc.lua @@ -189,3 +189,23 @@ client.connect_signal("mouse::enter", end) -- }}} + +-- show a notification on changing tag properties +do + local tag_prop_notify = { + master_count = {}, + column_count = {}, + } + + for name, tbl 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) + end) + end +end -- cgit v1.2.3