summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2021-11-20 14:00:00 -0500
committerGitHub <noreply@github.com>2021-11-20 14:00:00 -0500
commitd5308d3c7463d2a0915221103ca093727ee81f2e (patch)
treeb896e69e15539c3cfda556b70cb3a5fffcdb068e
parent8e39d6a535beee0d9642724c1028e047ff506e8a (diff)
parent42ddeeb509e5f9789a41d386d4bfc2acf56588c9 (diff)
Merge pull request #310 from utix/calendar/improvement
Calendar/improvement
-rw-r--r--calendar-widget/README.md47
-rw-r--r--calendar-widget/calendar.lua2
2 files changed, 33 insertions, 16 deletions
diff --git a/calendar-widget/README.md b/calendar-widget/README.md
index c7b46e2..e354c07 100644
--- a/calendar-widget/README.md
+++ b/calendar-widget/README.md
@@ -4,18 +4,28 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.
## Features
+
+### Customization
+
+| Name | Default | Description |
+|---|---|---|
+| theme | `naughty` | The theme to use |
+| placement | `top` | The position of the popup |
+| radius | 8 | The popup radius |
+| start_sunday | false | Start the week on Sunday |
+
- themes:
-
+
| Name | Screenshot |
|---|---|
- | nord (default) | ![nord_theme](./nord.png) |
- | outrun | ![outrun_theme](./outrun.png) |
- | light | ![outrun_theme](./light.png) |
- | dark | ![outrun_theme](./dark.png) |
+ | nord | ![nord_theme](./nord.png) |
+ | outrun | ![outrun_theme](./outrun.png) |
+ | light | ![outrun_theme](./light.png) |
+ | dark | ![outrun_theme](./dark.png) |
| naughty (default) | from local theme |
-
+
- setup widget placement
-
+
top center - in case you clock is centered:
![calendar_top](./calendar_top.png)
@@ -28,6 +38,10 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.
![calendar_bottom_right](./calendar_bottom_right.png)
+ - setup first day of week
+
+ By setting `start_sunday` to true:
+ ![calendar_start_sunday](./calendar_start_sunday.png)
- mouse support:
move to the next and previous month. Using mouse buttons or scroll wheel.
@@ -35,20 +49,20 @@ Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.
You can configure this by specifying the button to move to next/previous.
Usually these are configured as follows. If you want to use other mouse buttons, you can find their number using `xev`.
- | number | button |
- |--------|--------|
- | 4 | scroll up |
- | 5 | scroll down |
- | 1 | left click |
- | 2 | right click |
- | 3 | middles click |
+ | number | button |
+ |--------|---------------|
+ | 4 | scroll up |
+ | 5 | scroll down |
+ | 1 | left click |
+ | 2 | right click |
+ | 3 | middles click |
By default `previous_month_button` is 5, `next_month_button` is 4.
## How to use
-This widget needs an 'anchor' - another widget which triggers visibility of the calendar. Default `mytextclock` is the perfect candidate!
+This widget needs an 'anchor' - another widget which triggers visibility of the calendar. Default `mytextclock` is the perfect candidate!
Just after mytextclock is instantiated, create the widget and add the mouse listener to it.
```lua
@@ -62,12 +76,13 @@ local cw = calendar_widget()
local cw = calendar_widget({
theme = 'outrun',
placement = 'bottom_right',
+ start_sunday = true,
radius = 8,
-- with customized next/previous (see table above)
previous_month_button = 1,
next_month_button = 3,
})
-mytextclock:connect_signal("button::press",
+mytextclock:connect_signal("button::press",
function(_, _, _, button)
if button == 1 then cw.toggle() end
end)
diff --git a/calendar-widget/calendar.lua b/calendar-widget/calendar.lua
index d62f52b..4bb637f 100644
--- a/calendar-widget/calendar.lua
+++ b/calendar-widget/calendar.lua
@@ -97,6 +97,7 @@ local function worker(user_args)
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 start_sunday = args.start_sunday or false
local styles = {}
local function rounded_shape(size)
@@ -184,6 +185,7 @@ local function worker(user_args)
font = beautiful.get_font(),
fn_embed = decorate_cell,
long_weekdays = true,
+ start_sunday = start_sunday,
widget = wibox.widget.calendar.month
}