From 7eb3b2a453f85922456e46c69ec07821791769a3 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sat, 9 Nov 2024 13:57:48 -0500 Subject: [PATCH 1/2] Fix luacheck issues --- calendar-widget/calendar.lua | 4 ++-- mpris-widget/init.lua | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/calendar-widget/calendar.lua b/calendar-widget/calendar.lua index 4eab52b0..bfc41046 100644 --- a/calendar-widget/calendar.lua +++ b/calendar-widget/calendar.lua @@ -203,7 +203,7 @@ local function worker(user_args) border_color = calendar_themes[theme].border, widget = cal } - + local auto_hide_timer = gears.timer({ timeout = user_args.timeout or 2, single_shot = true, @@ -213,7 +213,7 @@ local function worker(user_args) }) popup:connect_signal("mouse::leave", function() - if user_args.auto_hide then + if user_args.auto_hide then auto_hide_timer:again() end end) diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua index 610aa867..8759fb6b 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -7,7 +7,6 @@ ------------------------------------------------- local awful = require('awful') local beautiful = require('beautiful') -local watch = require('awful.widget.watch') local wibox = require('wibox') local gears = require('gears') @@ -44,7 +43,7 @@ function playerctl:watch(timeout, callback, widget) self.watch_params = { timeout = timeout, callback = callback, widget = widget } - local cb = function(widget, stdout, _, _, _) + local cb = function(cb_widget, stdout, _, _, _) local words = gears.string.split(stdout, ';') local position, length, progress = tonumber(words[5]), tonumber(words[6]) @@ -68,7 +67,7 @@ function playerctl:watch(timeout, callback, widget) metadata.year = string.sub(words[8], 0, 4) end - callback(widget, metadata) + callback(cb_widget, metadata) end _, self.timer = awful.widget.watch(cmd, timeout, cb, widget) From b93080ee0ac2590005a96a806cd5a53c14dab8a9 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Mon, 11 Nov 2024 18:01:04 -0500 Subject: [PATCH 2/2] Update mpris-widget/init.lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Jaenisch --- mpris-widget/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua index 8759fb6b..e5e149a2 100644 --- a/mpris-widget/init.lua +++ b/mpris-widget/init.lua @@ -70,7 +70,8 @@ function playerctl:watch(timeout, callback, widget) callback(cb_widget, metadata) end - _, self.timer = awful.widget.watch(cmd, timeout, cb, widget) + local _, timer = awful.widget.watch(cmd, timeout, cb, widget) + self.timer = timer end function playerctl:toggle() awful.spawn(self:cmd('play-pause'), false) end