diff options
author | streetturtle <streetturtle@users.noreply.github.com> | 2020-12-07 15:33:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 15:33:55 -0500 |
commit | d4971690cec1e074999e730d87045e578d71e43c (patch) | |
tree | b0f05079840eba5467e14bdcd093ad3ed5362cf4 /gerrit-widget | |
parent | f078748e76eacae599cf0ad06120d9fff54f8fa5 (diff) | |
parent | ed2b256407291d8edadfcea9380029633cc7d9d8 (diff) |
Merge pull request #224 from streetturtle/comply-with-luacheck
Comply with luacheck
Diffstat (limited to 'gerrit-widget')
-rw-r--r-- | gerrit-widget/gerrit.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gerrit-widget/gerrit.lua b/gerrit-widget/gerrit.lua index ad5d7a6..682eb0f 100644 --- a/gerrit-widget/gerrit.lua +++ b/gerrit-widget/gerrit.lua @@ -27,13 +27,13 @@ local DOWNLOAD_AVATAR_CMD = [[bash -c "curl --create-dirs -o %s %s"]] local gerrit_widget = {} -local function worker(args) +local function worker(user_args) - local args = args or {} + local args = user_args or {} local icon = args.icons or HOME_DIR .. '/.config/awesome/awesome-wm-widgets/gerrit-widget/gerrit_icon.svg' local host = args.host or naughty.notify{ - preset = naughty.config.presets.critical, + preset = naughty.config.presets.critical, title = 'Gerrit Widget', text = 'Gerrit host is unknown' } @@ -93,11 +93,12 @@ local function worker(args) if name_dict[user_id].username == nil then name_dict[user_id].username = '' - spawn.easy_async(string.format(GET_USER_CMD, host, user_id), function(stdout, stderr, reason, exit_code) + spawn.easy_async(string.format(GET_USER_CMD, host, user_id), function(stdout) local user = json.decode(stdout) name_dict[tonumber(user_id)].username = user.name if not gfs.file_readable(PATH_TO_AVATARS .. user_id) then - spawn.easy_async(string.format(DOWNLOAD_AVATAR_CMD, PATH_TO_AVATARS .. user_id, user.avatars[1].url)) + spawn.easy_async( + string.format(DOWNLOAD_AVATAR_CMD, PATH_TO_AVATARS .. user_id, user.avatars[1].url)) end end) return name_dict[user_id].username @@ -124,7 +125,8 @@ local function worker(args) naughty.notify{ icon = HOME_DIR ..'/.config/awesome/awesome-wm-widgets/gerrit-widget/gerrit_icon.svg', title = 'New Incoming Review', - text = reviews[1].project .. '\n' .. get_name_by_user_id(reviews[1].owner._account_id) .. reviews[1].subject .. '\n', + text = reviews[1].project .. '\n' .. get_name_by_user_id(reviews[1].owner._account_id) .. + reviews[1].subject .. '\n', run = function() spawn.with_shell("xdg-open https://" .. host .. '/' .. reviews[1]._number) end } end @@ -174,7 +176,7 @@ local function worker(args) widget = wibox.container.background } - row:connect_signal("button::release", function(_, _, _, button) + row:connect_signal("button::release", function() spawn.with_shell("xdg-open " .. host .. '/' .. review._number) end) |