summaryrefslogtreecommitdiff
path: root/battery-widget
diff options
context:
space:
mode:
authorRobert Stoll <rstoll@tutteli.ch>2020-11-01 22:37:11 +0100
committerRobert Stoll <rstoll@tutteli.ch>2020-11-01 22:39:17 +0100
commit0915a81e5432c0e742bbd1114584b0e6d58e15e6 (patch)
tree83f3ad4ed5b831be0f4f95c1ce06bb2f007475b0 /battery-widget
parentef9292d082d74ac09cfc3e874ef8c933be9e0651 (diff)
show notification on right click for volume/battery
Diffstat (limited to 'battery-widget')
-rw-r--r--battery-widget/battery.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua
index 9fa50ed..8a6982a 100644
--- a/battery-widget/battery.lua
+++ b/battery-widget/battery.lua
@@ -32,6 +32,7 @@ local function worker(args)
local margin_right = args.margin_right or 0
local display_notification = args.display_notification or false
+ local display_notification_onClick = args.display_notification_onClick or true
local position = args.notification_position or "top_right"
local timeout = args.timeout or 10
@@ -182,7 +183,13 @@ local function worker(args)
if display_notification then
battery_widget:connect_signal("mouse::enter", function() show_battery_status(batteryType) end)
battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end)
+ elseif display_notification_onClick then
+ battery_widget:connect_signal("button::press", function(_,_,_,button)
+ if (button == 3) then show_battery_status(batteryType) end
+ end)
+ battery_widget:connect_signal("mouse::leave", function() naughty.destroy(notification) end)
end
+
return wibox.container.margin(battery_widget, margin_left, margin_right)
end