From 097daa7d44bc6eb758c45653b1c24413c4c11fdb Mon Sep 17 00:00:00 2001 From: Pavel Makhov Date: Mon, 30 Sep 2019 14:51:31 -0400 Subject: add left/right button click support --- gerrit-widget/gerrit.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'gerrit-widget') diff --git a/gerrit-widget/gerrit.lua b/gerrit-widget/gerrit.lua index e2d0e02..5cf5b75 100644 --- a/gerrit-widget/gerrit.lua +++ b/gerrit-widget/gerrit.lua @@ -129,6 +129,19 @@ local function worker(args) c:set_bg(beautiful.bg_normal) end) + row:buttons( + awful.util.table.join( + awful.button({}, 1, function() + spawn.with_shell("google-chrome https://" .. host .. '/' .. review._number) + popup.visible = false + end), + awful.button({}, 3, function() + spawn.with_shell("echo 'git-review -d " .. review._number .."' | xclip -selection clipboard") + popup.visible = false + end) + ) + ) + table.insert(rows, row) end @@ -138,12 +151,8 @@ local function worker(args) gerrit_widget:buttons( awful.util.table.join( awful.button({}, 1, function() - --awful.placement.top_right(w, { margins = {top = 25, right = 10}, parent = awful.screen.focused() }) - --w.visible = not w.visible awful.placement.top_right(popup, { margins = { top = 25, right = 10}, parent = awful.screen.focused() }) popup.visible = not popup.visible - --ww:move_next_to(gerrit_widget) - --awful.placement.next_to(ww, gerrit_widget) end) ) ) -- cgit v1.2.3