2019-12-13 04:39:16 +01:00
|
|
|
# Calendar Widget
|
|
|
|
|
2019-12-16 04:10:22 +01:00
|
|
|
Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.calendar`.
|
2019-12-13 04:39:16 +01:00
|
|
|
|
2019-12-16 04:10:22 +01:00
|
|
|
## Features
|
2019-12-13 04:39:16 +01:00
|
|
|
|
2021-10-20 14:15:18 +02:00
|
|
|
|
|
|
|
### Customization
|
|
|
|
|
2023-11-23 17:31:08 +01:00
|
|
|
| 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 |
|
2021-10-20 14:15:18 +02:00
|
|
|
|
2019-12-16 04:10:22 +01:00
|
|
|
- themes:
|
2021-10-20 14:15:18 +02:00
|
|
|
|
2019-12-16 04:14:02 +01:00
|
|
|
| Name | Screenshot |
|
|
|
|
|---|---|
|
2021-10-20 14:15:18 +02:00
|
|
|
| nord | ![nord_theme](./nord.png) |
|
|
|
|
| outrun | ![outrun_theme](./outrun.png) |
|
|
|
|
| light | ![outrun_theme](./light.png) |
|
|
|
|
| dark | ![outrun_theme](./dark.png) |
|
2020-11-21 12:38:51 +01:00
|
|
|
| naughty (default) | from local theme |
|
2021-10-20 14:15:18 +02:00
|
|
|
|
2019-12-16 04:10:22 +01:00
|
|
|
- setup widget placement
|
2021-10-20 14:15:18 +02:00
|
|
|
|
2019-12-16 04:10:22 +01:00
|
|
|
top center - in case you clock is centered:
|
|
|
|
|
|
|
|
![calendar_top](./calendar_top.png)
|
|
|
|
|
|
|
|
top right - for default awesome config:
|
|
|
|
|
|
|
|
![calendar_top_right](./calendar_top_right.png)
|
|
|
|
|
|
|
|
bottom right - in case your wibar at the bottom:
|
|
|
|
|
|
|
|
![calendar_bottom_right](./calendar_bottom_right.png)
|
|
|
|
|
2021-10-20 14:27:00 +02:00
|
|
|
- setup first day of week
|
|
|
|
|
|
|
|
By setting `start_sunday` to true:
|
|
|
|
![calendar_start_sunday](./calendar_start_sunday.png)
|
2019-12-16 04:10:22 +01:00
|
|
|
|
2021-11-20 02:21:32 +01:00
|
|
|
- mouse support:
|
|
|
|
move to the next and previous month. Using mouse buttons or scroll wheel.
|
|
|
|
|
|
|
|
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`.
|
|
|
|
|
2021-10-20 14:27:00 +02:00
|
|
|
| number | button |
|
|
|
|
|--------|---------------|
|
|
|
|
| 4 | scroll up |
|
|
|
|
| 5 | scroll down |
|
|
|
|
| 1 | left click |
|
|
|
|
| 2 | right click |
|
|
|
|
| 3 | middles click |
|
2021-11-20 02:21:32 +01:00
|
|
|
|
|
|
|
By default `previous_month_button` is 5, `next_month_button` is 4.
|
|
|
|
|
|
|
|
|
2019-12-16 04:10:22 +01:00
|
|
|
## How to use
|
2019-12-13 04:39:16 +01:00
|
|
|
|
2021-10-20 14:15:18 +02:00
|
|
|
This widget needs an 'anchor' - another widget which triggers visibility of the calendar. Default `mytextclock` is the perfect candidate!
|
2019-12-16 22:43:39 +01:00
|
|
|
Just after mytextclock is instantiated, create the widget and add the mouse listener to it.
|
2019-12-13 04:39:16 +01:00
|
|
|
|
|
|
|
```lua
|
|
|
|
local calendar_widget = require("awesome-wm-widgets.calendar-widget.calendar")
|
|
|
|
-- ...
|
|
|
|
-- Create a textclock widget
|
|
|
|
mytextclock = wibox.widget.textclock()
|
2019-12-16 04:10:22 +01:00
|
|
|
-- default
|
2019-12-16 22:43:39 +01:00
|
|
|
local cw = calendar_widget()
|
2019-12-16 04:10:22 +01:00
|
|
|
-- or customized
|
2019-12-16 22:43:39 +01:00
|
|
|
local cw = calendar_widget({
|
2019-12-16 04:10:22 +01:00
|
|
|
theme = 'outrun',
|
2021-04-15 22:29:19 +02:00
|
|
|
placement = 'bottom_right',
|
2021-10-20 14:27:00 +02:00
|
|
|
start_sunday = true,
|
2021-04-15 22:29:19 +02:00
|
|
|
radius = 8,
|
2021-11-20 02:21:32 +01:00
|
|
|
-- with customized next/previous (see table above)
|
|
|
|
previous_month_button = 1,
|
|
|
|
next_month_button = 3,
|
2019-12-16 04:10:22 +01:00
|
|
|
})
|
2021-10-20 14:15:18 +02:00
|
|
|
mytextclock:connect_signal("button::press",
|
2019-12-13 04:39:16 +01:00
|
|
|
function(_, _, _, button)
|
2019-12-16 04:10:22 +01:00
|
|
|
if button == 1 then cw.toggle() end
|
2019-12-13 04:39:16 +01:00
|
|
|
end)
|
2019-12-16 04:10:22 +01:00
|
|
|
```
|