diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2021-07-13 10:47:39 -0400 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2021-08-17 09:52:24 -0400 |
commit | 466798679e7a2889622a491c776530c06668ca9f (patch) | |
tree | c0ebb8bdc0cc940f7cce465899a126f0f79a04ba /plugins/bigclock.lua | |
parent | fb647f8f0d972e85ac323b12eb65edf9c56b48cb (diff) | |
download | lite-xl-plugins-466798679e7a2889622a491c776530c06668ca9f.tar.gz lite-xl-plugins-466798679e7a2889622a491c776530c06668ca9f.zip |
Namespaced plugin configs.
Diffstat (limited to 'plugins/bigclock.lua')
-rw-r--r-- | plugins/bigclock.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/bigclock.lua b/plugins/bigclock.lua index c7e2eb1..62cbc0c 100644 --- a/plugins/bigclock.lua +++ b/plugins/bigclock.lua @@ -7,9 +7,11 @@ local config = require "core.config" local View = require "core.view" -config.bigclock_time_format = "%H:%M:%S" -config.bigclock_date_format = "%A, %d %B %Y" -config.bigclock_scale = 1 +config.plugins.bigclock = { + time_format = "%H:%M:%S", + date_format = "%A, %d %B %Y" + scale = 1 +} local ClockView = View:extend() @@ -28,7 +30,7 @@ end function ClockView:update_fonts() - local size = math.floor(self.size.x * 0.15 / 15) * 15 * config.bigclock_scale + local size = math.floor(self.size.x * 0.15 / 15) * 15 * config.plugins.bigclock.scale if self.font_size ~= size then self.time_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", size) self.date_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", size * 0.3) @@ -40,8 +42,8 @@ end function ClockView:update() - local time_text = os.date(config.bigclock_time_format) - local date_text = os.date(config.bigclock_date_format) + local time_text = os.date(config.plugins.bigclock.time_format) + local date_text = os.date(config.plugins.bigclock.date_format) if self.time_text ~= time_text or self.date_text ~= date_text then core.redraw = true self.time_text = time_text |