mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-28 12:30:01 +02:00
widgets: fix calendar widget
This commit is contained in:
parent
e6ac80e75b
commit
58d7c0fcfa
1 changed files with 2 additions and 2 deletions
|
@ -42,14 +42,14 @@ local cal = (
|
||||||
datespec = (datespec % 12 + 1) .. " " .. math.floor(datespec / 12)
|
datespec = (datespec % 12 + 1) .. " " .. math.floor(datespec / 12)
|
||||||
local cal = awful.util.pread("ncal -w -m " .. datespec)
|
local cal = awful.util.pread("ncal -w -m " .. datespec)
|
||||||
-- Highlight the current date and month
|
-- Highlight the current date and month
|
||||||
cal = cal:gsub("_.(%d)",
|
cal = cal:gsub("_.([%d ])",
|
||||||
string.format('<span color="%s">%%1</span>',
|
string.format('<span color="%s">%%1</span>',
|
||||||
beautiful.fg_widget_clock))
|
beautiful.fg_widget_clock))
|
||||||
cal = cal:gsub("^( +[^ ]+ [0-9]+) *",
|
cal = cal:gsub("^( +[^ ]+ [0-9]+) *",
|
||||||
string.format('<span color="%s">%%1</span>',
|
string.format('<span color="%s">%%1</span>',
|
||||||
beautiful.fg_widget_clock))
|
beautiful.fg_widget_clock))
|
||||||
-- Turn anything other than days in labels
|
-- Turn anything other than days in labels
|
||||||
cal = cal:gsub("(\n[^%d]+)",
|
cal = cal:gsub("(\n[^%d ]+)",
|
||||||
string.format('<span color="%s">%%1</span>',
|
string.format('<span color="%s">%%1</span>',
|
||||||
beautiful.fg_widget_label))
|
beautiful.fg_widget_label))
|
||||||
cal = cal:gsub("([%d ]+)\n?$",
|
cal = cal:gsub("([%d ]+)\n?$",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue