summaryrefslogtreecommitdiff
path: root/calendar-widget/calendar.lua
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2021-11-19 20:24:58 -0500
committerGitHub <noreply@github.com>2021-11-19 20:24:58 -0500
commit050f328c321c0d9fc585a63452bb830e20ce62a0 (patch)
tree6085c920d06ac19a0193d147d84fc9ace134cd1d /calendar-widget/calendar.lua
parent2fae9e01a7e007f7fe8fc36c6676d79f160c3198 (diff)
parent80f6bb2c05f7b3fc81c0b8c881e7f52bdc88c00a (diff)
Merge pull request #312 from miselico/master
Added the option to customize te mousebuttons for going to the previous and next month
Diffstat (limited to 'calendar-widget/calendar.lua')
-rw-r--r--calendar-widget/calendar.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/calendar-widget/calendar.lua b/calendar-widget/calendar.lua
index 81c28a9..d62f52b 100644
--- a/calendar-widget/calendar.lua
+++ b/calendar-widget/calendar.lua
@@ -95,7 +95,8 @@ local function worker(user_args)
local theme = args.theme or 'naughty'
local placement = args.placement or 'top'
local radius = args.radius or 8
-
+ local next_month_button = args.next_month_button or 4
+ local previous_month_button = args.previous_month_button or 5
local styles = {}
local function rounded_shape(size)
@@ -198,14 +199,14 @@ local function worker(user_args)
popup:buttons(
awful.util.table.join(
- awful.button({}, 4, function()
+ awful.button({}, next_month_button, function()
local a = cal:get_date()
a.month = a.month + 1
cal:set_date(nil)
cal:set_date(a)
popup:set_widget(cal)
end),
- awful.button({}, 5, function()
+ awful.button({}, previous_month_button, function()
local a = cal:get_date()
a.month = a.month - 1
cal:set_date(nil)