button click interpreted twice

This page summarizes the projects mentioned and recommended in the original post on /r/awesomewm

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • awesome-wm-widgets

    Widgets for Awesome Window Manager

  • ------------------------------------------------- -- Logout Menu Widget for Awesome Window Manager -- More details could be found here: -- https://github.com/streetturtle/awesome-wm-widgets/tree/master/logout-menu-widget -- @author Pavel Makhov -- @copyright 2020 Pavel Makhov ------------------------------------------------- local awful = require("awful") local wibox = require("wibox") local gears = require("gears") local beautiful = require("beautiful") local naughty = require("naughty") local HOME = os.getenv('HOME') local ICON_DIR = HOME .. '/.config/awesome/awesome-wm-widgets/logout-menu-widget/icons/' local logout_menu_widget = wibox.widget { { { image = ICON_DIR .. 'power_w.svg', resize = true, id = "iimage", widget = wibox.widget.imagebox, }, margins = 4, layout = wibox.container.margin }, shape = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 4) end, widget = wibox.container.background, } local popup = awful.popup { ontop = true, visible = false, shape = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 4) end, border_width = 1, border_color = beautiful.bg_focus, maximum_width = 400, offset = { y = 5 }, widget = {} } local function worker(user_args) local rows = { layout = wibox.layout.fixed.vertical } local args = user_args or {} local font = args.font or beautiful.font local onlogout = args.onlogout or function () awesome.quit() end local onlock = args.onlock or function() awful.spawn.with_shell("i3lock") end local onreboot = args.onreboot or function() awful.spawn.with_shell("reboot") end local onsuspend = args.onsuspend or function() awful.spawn.with_shell("systemctl suspend") end local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end local menu_items = { { name = 'Log out', icon_name = 'log-out.svg', command = onlogout }, { name = 'Lock', icon_name = 'lock.svg', command = onlock }, { name = 'Reboot', icon_name = 'refresh-cw.svg', command = onreboot }, { name = 'Suspend', icon_name = 'moon.svg', command = onsuspend }, { name = 'Power off', icon_name = 'power.svg', command = onpoweroff }, } for _, item in ipairs(menu_items) do local row = wibox.widget { { { { image = ICON_DIR .. item.icon_name, resize = false, widget = wibox.widget.imagebox }, { text = item.name, font = font, widget = wibox.widget.textbox }, spacing = 12, layout = wibox.layout.fixed.horizontal }, margins = 8, layout = wibox.container.margin }, bg = beautiful.bg_normal, widget = wibox.container.background } row:connect_signal("mouse::enter", function(c) c:set_bg(beautiful.bg_focus) end) row:connect_signal("mouse::leave", function(c) c:set_bg(beautiful.bg_normal) end) local old_cursor, old_wibox row:connect_signal("mouse::enter", function() local wb = mouse.current_wibox old_cursor, old_wibox = wb.cursor, wb wb.cursor = "hand1" end) row:connect_signal("mouse::leave", function() if old_wibox then old_wibox.cursor = old_cursor old_wibox = nil end end) --row:buttons(awful.util.table.join(awful.button({}, 1, function() -- popup.visible = not popup.visible -- item.command() --end))) row:add_button(awful.button({}, 1, function() popup.visible = not popup.visible item.command() end)) table.insert(rows, row) end popup:setup(rows) -- logout_menu_widget:buttons( -- awful.util.table.join( -- awful.button({}, 1, function() -- if popup.visible then -- popup.visible = not popup.visible -- logout_menu_widget:set_bg('#00000000') -- else -- popup:move_next_to(mouse.current_widget_geometry) -- logout_menu_widget:set_bg(beautiful.bg_focus) -- end -- end) -- ) -- ) logout_menu_widget:add_button( awful.button({}, 1, function() naughty.notify({text = "button pressed"}) if popup.visible then naughty.notify({text = "visible"}) popup.visible = not popup.visible logout_menu_widget:set_bg('#00000000') else naughty.notify({text = "invisible"}) popup:move_next_to(mouse.current_widget_geometry) logout_menu_widget:set_bg(beautiful.bg_focus) end end, function() naughty.notify({text = "button released"}) end) ) return logout_menu_widget end return setmetatable(logout_menu_widget, { __call = function(_, ...) return worker(...) end })

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How do I get the batteryarc-widget to work properly?

    1 project | /r/awesomewm | 26 Aug 2023
  • Widget help.

    1 project | /r/awesomewm | 28 Apr 2023
  • How do i add a power button to the wibar

    1 project | /r/awesomewm | 13 Mar 2023
  • Need help installing awesome-wm-widgets widgets, I tried with the volume widget and then spotify and both times adding the code in the read me to different places in the rc.lua and each time saving and reloading awesomewm caused it to reset to default settings with a slew of errors and no widget

    1 project | /r/awesomewm | 8 Nov 2022
  • Issues with brightness keys

    1 project | /r/awesomewm | 29 Oct 2022