summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Schodet2017-09-07 14:03:06 +0200
committerNicolas Schodet2017-09-07 14:03:06 +0200
commit2a958b324624ef16f5edb424b9ca75a8eec20c52 (patch)
treec4508c2b3791270b97dfe71a8e03295ecf51be2e
parent79b48db4ef04c464898208df7639123f61b35781 (diff)
widget/cal: port to 4.0
-rw-r--r--rc.lua4
-rw-r--r--widgets/cal.lua8
2 files changed, 5 insertions, 7 deletions
diff --git a/rc.lua b/rc.lua
index b5b6ff2..a92ace9 100644
--- a/rc.lua
+++ b/rc.lua
@@ -42,7 +42,7 @@ end
-- Load my modules
--require("vicious")
--require("widgets.volume")
---require("widgets.cal")
+local cal = require("widgets.cal")
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
@@ -129,7 +129,7 @@ mykeyboardlayout = awful.widget.keyboardlayout()
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
---widgets.cal.register(mytextclock)
+cal.register(mytextclock)
-- Create my widgets
--[[
diff --git a/widgets/cal.lua b/widgets/cal.lua
index 24c9755..10dc982 100644
--- a/widgets/cal.lua
+++ b/widgets/cal.lua
@@ -88,14 +88,12 @@ function register(mywidget, custom_current_day_format)
function tooltip:update()
local month, year = os.date('%m'), os.date('%Y')
state = {month, year}
- tooltip:set_text(string.format('<span font_desc="monospace">%s</span>', displayMonth(month, year, 2)))
+ tooltip:set_markup(displayMonth(month, year, 2))
end
tooltip:update()
end
tooltip:add_to_object(mywidget)
- mywidget:add_signal("mouse::enter",tooltip.update)
-
mywidget:buttons(awful.util.table.join(
awful.button({ }, 1, function()
switchMonth(-1)
@@ -125,6 +123,6 @@ end
function switchMonth(delta)
state[1] = state[1] + (delta or 1)
- local text = string.format('<span font_desc="monospace">%s</span>', displayMonth(state[1], state[2], 2))
- tooltip:set_text(text)
+ local text = displayMonth(state[1], state[2], 2)
+ tooltip:set_markup(text)
end