From be6d28ec6dee82f431f67e02a2f21fbd2333c2d5 Mon Sep 17 00:00:00 2001 From: Nuno Silva Date: Sun, 11 Apr 2021 20:06:51 +0100 Subject: brightness-widget: remove undefined vars --- brightness-widget/brightness.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/brightness-widget/brightness.lua b/brightness-widget/brightness.lua index d5a79a9..2afb38a 100644 --- a/brightness-widget/brightness.lua +++ b/brightness-widget/brightness.lua @@ -90,9 +90,7 @@ local function worker(user_args) start_angle = 4.71238898, -- 2pi*3/4 forced_height = 18, forced_width = 18, - bg = bg_color, paddings = 2, - colors = {color}, widget = wibox.container.arcchart, set_value = function(self, level) self:set_value(level) -- cgit v1.2.3 From 8cc7b6dbfe8eeb07a0bdf70598219036ead33614 Mon Sep 17 00:00:00 2001 From: Nuno Silva Date: Sun, 11 Apr 2021 20:31:27 +0100 Subject: github-contributions-widget: fix line too long warning --- github-contributions-widget/github-contributions-widget.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github-contributions-widget/github-contributions-widget.lua b/github-contributions-widget/github-contributions-widget.lua index cae8ed6..aecc966 100644 --- a/github-contributions-widget/github-contributions-widget.lua +++ b/github-contributions-widget/github-contributions-widget.lua @@ -14,7 +14,8 @@ local wibox = require("wibox") local widget_themes = require("awesome-wm-widgets.github-contributions-widget.themes") local GET_CONTRIBUTIONS_CMD = [[bash -c "curl -s https://github-contributions.now.sh/api/v1/%s]] - .. [[ | jq -r '[.contributions[] | select ( .date | strptime(\"%%Y-%%m-%%d\") | mktime < now)][:%s]| .[].intensity'"]] + .. [[ | jq -r '[.contributions[] ]] + .. [[ | select ( .date | strptime(\"%%Y-%%m-%%d\") | mktime < now)][:%s]| .[].intensity'"]] local github_contributions_widget = wibox.widget{ reflection = { -- cgit v1.2.3 From a47ccb782f3e09c1d19536ed298eadae3bfa5219 Mon Sep 17 00:00:00 2001 From: Nuno Silva Date: Sun, 11 Apr 2021 20:48:09 +0100 Subject: experiments/apt-widget: fix/silent warnings - unused function ellipsize - unused variable one - line is too long (146 > 120) - unused argument stdout,stderr - unused loop variable i - shadowing upvalue i on line 131 --- experiments/apt-widget/apt-widget.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/experiments/apt-widget/apt-widget.lua b/experiments/apt-widget/apt-widget.lua index df93bd6..9d35b0e 100644 --- a/experiments/apt-widget/apt-widget.lua +++ b/experiments/apt-widget/apt-widget.lua @@ -29,6 +29,7 @@ local function show_warning(message) text = message} end +-- luacheck:ignore ellipsize local function ellipsize(text, length) return (text:len() > length and length > 0) and text:sub(0, length - 3) .. '...' @@ -65,6 +66,7 @@ local apt_widget = wibox.widget { --yaru-theme-sound/focal-updates,focal-updates 20.04.10.1 all [upgradable from: 20.04.8] local parse_package = function(line) + --luacheck:ignore 211 local name,one,nv,type,ov = line:match('(.*)%/(.*)%s(.*)%s(.*)%s%[upgradable from: (.*)]') if name == nil then return nil end @@ -128,7 +130,6 @@ local function worker(user_args) end end) - local i = 1 for line in containers:gmatch("[^\r\n]+") do local package = parse_package(line) @@ -230,8 +231,10 @@ local function worker(user_args) self:get_children_by_id('name')[1]:set_opacity(0.4) self:get_children_by_id('name')[1]:emit_signal('widget::redraw_needed') - spawn.easy_async(string.format([[sh -c 'yes | aptdcon --hide-terminal -u %s']], package['name']), function(stdout, stderr) - rows:remove_widgets(self) + spawn.easy_async( + string.format([[sh -c 'yes | aptdcon --hide-terminal -u %s']], package['name']), + function(stdout, stderr) -- luacheck:ignore 212 + rows:remove_widgets(self) end) end @@ -254,8 +257,6 @@ local function worker(user_args) rows:add(row) end - - i = i + 1 end @@ -285,6 +286,7 @@ local function worker(user_args) widget = wibox.widget.imagebox } header_refresh_icon:buttons(awful.util.table.join(awful.button({}, 1, function() + -- luacheck:ignore 213 for i,v in pairs(to_update) do if v ~= nil then v:update() -- cgit v1.2.3