Hi,
On 08.11.2011 15:33, Matija Žeželj wrote:
[..]
> function add_calendar(inc_offset)
> local save_offset = offset
> remove_calendar()
> offset = save_offset + inc_offset
> local datespec = os.date("*t")
> datespec = datespec.year * 12 + datespec.month - 1 + offset
> datespec = (datespec % 12 + 1) .. " " .. math.floor(datespec / 12)
> local cal = awful.util.pread("cal " .. datespec)
You could use "cal -h" to turn off highlighting.
> cal = string.gsub(cal, "^%s*(.-)%s*$", "%1")
> calendar = naughty.notify({
> text = string.format('<span font_desc="%s">%s</span>',
> "Profont", os.date("%a, %d. %B %Y") .. "\n" .. cal),
> timeout = 0, hover_timeout = 0.5,
> width = 165,
> })
> end
[...]
The above is the quick fix. The long fix would be lots of magic.
cal uses shell escape sequences to highlight the current date. Those only work
in the shell. So the "real" fix would be to figure out how to match those shell
escapes and replace them with pango markup. And no, don't ask me about details,
I don't know.
Uli.
--
- He made himself, me nothing, you nothing out of the dust
- Er machte sich mir nichts, dir nichts aus dem Staub
--
To unsubscribe, send mail to [email protected].