From 81dcf7de91c1866d565f7aa9eb38f7fbd1cd7ad7 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 25 Jul 2025 20:27:44 +0530 Subject: Add decoration is_enabled api + allowed specifying win_id for enabled --- init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index ffbff29..7498e70 100644 --- a/init.lua +++ b/init.lua @@ -61,18 +61,18 @@ web.event.add_listener('NotificationReceived', { end, }) --- EVENT for window creation for setting up decorations --- web.decorations.top.enable() --- web.decorations.bottom.enable() +web.event.add_listener('WinCreated', { + callback = function(event) + web.decorations.bottom.enable({ win = event.win_id }) + end, +}) web.keymap.set('n', 'gg', function() - web.decorations.top.enable() - web.decorations.bottom.enable() -end) - -web.keymap.set('n', 'gt', function() - web.decorations.top.disable() - web.decorations.bottom.disable() + if web.decorations.bottom.is_enabled({ win = 0 }) then + web.decorations.bottom.disable({ win = 0 }) + else + web.decorations.bottom.enable({ win = 0 }) + end end) print('ending...') -- cgit v1.3.1