2019-12-15 21:38:54 +01:00
|
|
|
---
|
|
|
|
layout: page
|
|
|
|
---
|
|
|
|
# Calendar Widget
|
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
Calendar widget for Awesome WM - slightly improved version of the `wibox.widget.calendar`.
|
2019-12-15 21:38:54 +01:00
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
## Features
|
2019-12-15 21:38:54 +01:00
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
- mouse support: scroll up - shows next month, scroll down - previous
|
|
|
|
- themes:
|
|
|
|
|
|
|
|
nord (default):
|
2019-12-15 21:38:54 +01:00
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
![nord_theme](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/nord.png)
|
2019-12-15 21:38:54 +01:00
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
outrun:
|
2019-12-15 21:38:54 +01:00
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
![outrun_theme](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/outrun.png)
|
2019-12-15 21:38:54 +01:00
|
|
|
|
2019-12-16 04:09:49 +01:00
|
|
|
- setup widget placement
|
|
|
|
|
|
|
|
top center - in case you clock is centered:
|
|
|
|
|
|
|
|
![calendar_top](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/calendar_top.png)
|
|
|
|
|
|
|
|
top right - for default awesome config:
|
|
|
|
|
|
|
|
![calendar_top_right](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/calendar_top_right.png)
|
|
|
|
|
|
|
|
bottom right - in case your wibar at the bottom:
|
|
|
|
|
|
|
|
![calendar_bottom_right](../awesome-wm-widgets/assets/img/screenshots/calendar-widget/calendar_bottom_right.png)
|
|
|
|
|
|
|
|
|
|
|
|
## How to use
|
2019-12-15 21:38:54 +01:00
|
|
|
|
|
|
|
This widget needs an 'anchor' - another widget which triggers visibility of the calendar. Default `mytextclock` is the perfect candidate!
|
|
|
|
|
|
|
|
```lua
|
|
|
|
local calendar_widget = require("awesome-wm-widgets.calendar-widget.calendar")
|
|
|
|
-- ...
|
2019-12-16 04:09:49 +01:00
|
|
|
-- {{{ Wibar
|
2019-12-15 21:38:54 +01:00
|
|
|
-- Create a textclock widget
|
|
|
|
mytextclock = wibox.widget.textclock()
|
2019-12-16 04:09:49 +01:00
|
|
|
-- default
|
|
|
|
cw = calendar_widget()
|
|
|
|
-- or customized
|
|
|
|
cw = calendar_widget({
|
|
|
|
theme = 'outrun',
|
|
|
|
placement = 'bottom_right'
|
|
|
|
})
|
|
|
|
mytextclock:connect_signal("button::press",
|
2019-12-15 21:38:54 +01:00
|
|
|
function(_, _, _, button)
|
2019-12-16 04:09:49 +01:00
|
|
|
if button == 1 then cw.toggle() end
|
2019-12-15 21:38:54 +01:00
|
|
|
end)
|
2019-12-16 04:09:49 +01:00
|
|
|
```
|