X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/978e912a0a08bbf19aec66e19b4fe8dfe4b0c524..f996cdb74e7583534256d82706ef63d2b9811b42:/calendar.md diff --git a/calendar.md b/calendar.md index bfceac9..b06c453 100644 --- a/calendar.md +++ b/calendar.md @@ -1,35 +1,31 @@ -Attaches a calendar to a widget. +[<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets) - lain.widgets.calendar:attach(mywidget) +Attaches a calendar notification to a widget. + + lain.widgets.calendar:attach(widget, args) - Left click: switch to previous month. - Right click: switch to next month. -Optionally you can call the function with background and foreground colors arguments, both or just one: +`args` is an optional table which can contain: + +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" - lain.widgets.calendar:attach(mytextclock, "#FFFFFF", "#000000") - -- or - lain.widgets.calendar:attach(mytextclock, "#FFFFFF") - -- or - lain.widgets.calendar:attach(mytextclock, nil, "#000000") +`position` possible values are defined [here](http://awesome.naquadah.org/doc/api/modules/naughty.html#notify). Notification will show an icon displaying current day, and formatted output from ``cal`` with current day highlighted. -Calendar icons are placed in [lain/icons/cal](https://github.com/copycat-killer/lain/tree/master/icons/cal), default set being ``white``. - -You can add your own set, and tell lain to use it like this: - - lain.widgets.calendar.icons_dir = lain.widgets.icons_dir .. "cal/myicons" - -also, you can set notification font size: - - lain.widgets.calendar.font_size = 14 - -default is 12. - -Finally, you can call the notification with a key binding like this: +You can call the notification with a key binding like this: awful.key({ altkey }, "c", function () lain.widgets.calendar:show(7) end), -where ``altkey = "Mod1"`` and ``show`` argument is an optional integer, meaning timeout seconds. \ No newline at end of file +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. \ No newline at end of file