summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2021-06-13 13:53:27 +0200
committerAnton Khirnov <anton@khirnov.net>2021-06-13 13:53:27 +0200
commit7d64cce93bee8af0ef017ae5b56d9e5b5499d4f7 (patch)
tree45981f5bb70f9c71837ce24b53ab9181c9fd407f
parentf683eb374f4f49f085e81b0a4e937e471cc1ee16 (diff)
rc: notify on new values of tag properties
-rw-r--r--rc.lua20
1 files changed, 20 insertions, 0 deletions
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