From 031b22e0bb0f1d132731aea3776917731a8ab4ce Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Fri, 25 Jul 2025 23:17:02 +0530 Subject: Add decorations.*.view lua api + support decoration views for open url --- init.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 7498e70..b16b08a 100644 --- a/init.lua +++ b/init.lua @@ -61,12 +61,21 @@ web.event.add_listener('NotificationReceived', { end, }) +-- Decorations config web.event.add_listener('WinCreated', { callback = function(event) web.decorations.bottom.enable({ win = event.win_id }) + local timer = web.uv.new_timer() + timer:start(100, 0, function() + local view = web.decorations.bottom.view({ win = event.win_id }) + print('>>> view', view) + if view ~= nil then + web.view.set_url('https://google.com', view) + end + timer:close() + end) end, }) - web.keymap.set('n', 'gg', function() if web.decorations.bottom.is_enabled({ win = 0 }) then web.decorations.bottom.disable({ win = 0 }) -- cgit v1.3.1