summaryrefslogtreecommitdiff
path: root/stackoverflow-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-12-02 09:24:05 -0500
committerstreetturtle <streetturtle@gmail.com>2020-12-02 22:04:23 -0500
commitd9eb3885eea90e06b79ff8fc4b2d1c1b8f5e4cfd (patch)
tree573bfe1b0adfc92532cce39a44b8828407e1f79d /stackoverflow-widget
parente3d3e07af3a18331711e897d9928701d9ac21839 (diff)
trigger build action on a branch
Diffstat (limited to 'stackoverflow-widget')
-rw-r--r--stackoverflow-widget/stackoverflow.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/stackoverflow-widget/stackoverflow.lua b/stackoverflow-widget/stackoverflow.lua
index af89105..15d2837 100644
--- a/stackoverflow-widget/stackoverflow.lua
+++ b/stackoverflow-widget/stackoverflow.lua
@@ -18,13 +18,15 @@ local beautiful = require("beautiful")
local HOME_DIR = os.getenv("HOME")
-local GET_QUESTIONS_CMD = [[bash -c "curl --compressed -s -X GET 'http://api.stackexchange.com/2.2/questions/no-answers?page=1&pagesize=%s&order=desc&sort=activity&tagged=%s&site=stackoverflow'"]]
+local GET_QUESTIONS_CMD = [[bash -c "curl --compressed -s -X GET]]
+ .. [[ 'http://api.stackexchange.com/2.2/questions/no-answers]]
+ .. [[?page=1&pagesize=%s&order=desc&sort=activity&tagged=%s&site=stackoverflow'"]]
local stackoverflow_widget = {}
-local function worker(args)
+local function worker(user_args)
- local args = args or {}
+ local args = user_args or {}
local icon = args.icon or HOME_DIR .. '/.config/awesome/awesome-wm-widgets/stackoverflow-widget/so-icon.svg'
local limit = args.limit or 5
@@ -43,7 +45,7 @@ local function worker(args)
border_width = 1,
border_color = beautiful.bg_focus,
maximum_width = 400,
- preferred_positions = top,
+ preferred_positions = 'top',
offset = { y = 5 },
widget = {}
}
@@ -63,7 +65,7 @@ local function worker(args)
end,
}
- local update_widget = function(widget, stdout, stderr, _, _)
+ local update_widget = function(_, stdout, _, _, _)
local result = json.decode(stdout)
@@ -91,7 +93,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 " .. item.link)
popup.visible = false
end)