2013-09-08 01:35:54 +02:00
[<- widgets ](https://github.com/copycat-killer/lain/wiki/Widgets )
2013-09-07 14:12:52 +02:00
Attaches a calendar notification to a widget.
2013-09-07 12:30:54 +02:00
2013-09-10 22:40:31 +02:00
lain.widgets.calendar:attach(widget, args)
2013-09-07 12:30:54 +02:00
- Left click: switch to previous month.
- Right click: switch to next month.
2013-09-10 22:40:31 +02:00
`args` is an optional table which can contain:
2013-09-07 12:30:54 +02:00
2013-09-10 22:40:31 +02:00
Variable | Meaning | Type | Default
--- | --- | --- | ---
`icons` | Path to calendar icons | string | [lain/icons/cal/white ](https://github.com/copycat-killer/lain/tree/master/icons/cal/white )
`font_size` | Calendar font size | int | 12
`fg` | Calendar foreground color | string | `beautiful.fg_normal`
`bg` | Calendar background color | string | `beautiful.bg_normal`
`position` | Calendar position | string | "top_right"
2013-09-07 12:30:54 +02:00
2013-09-10 22:40:31 +02:00
`position` possible values are defined [here ](http://awesome.naquadah.org/doc/api/modules/naughty.html#notify ).
2013-09-08 01:20:57 +02:00
2013-09-07 12:30:54 +02:00
Notification will show an icon displaying current day, and formatted output
from ``cal`` with current day highlighted.
2013-09-10 22:40:31 +02:00
You can call the notification with a key binding like this:
2013-09-07 12:30:54 +02:00
awful.key({ altkey }, "c", function () lain.widgets.calendar:show(7) end),
2014-01-02 12:16:09 +01:00
where ``altkey = "Mod1"`` and ``show`` argument is an optional integer, meaning timeout seconds.
**Note that** this widget exploits ``cal`` to do the alignment, in order to avoid more dozens of code lines, but this requires that your system font is monospaced.