From e98d2eeb291c14a98a42ce84299ffe85397c8c94 Mon Sep 17 00:00:00 2001 From: Luke Bonham Date: Wed, 16 Aug 2017 12:46:23 +0200 Subject: [PATCH] powearrow: binclock code syntax improved --- themes/powerarrow/binclock.lua | 28 ++++++++++++++-------------- themes/vertex/theme.lua | 9 +++++---- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/themes/powerarrow/binclock.lua b/themes/powerarrow/binclock.lua index 9d144dc..ef620af 100644 --- a/themes/powerarrow/binclock.lua +++ b/themes/powerarrow/binclock.lua @@ -7,13 +7,13 @@ --]] -local gears = require("gears") -local wibox = require("wibox") -local date = os.date -local ipairs = ipairs -local math = math -local select = select -local string = string +local gears = require("gears") +local wibox = require("wibox") +local date = os.date +local ipairs = ipairs +local math = math +local select = select +local string = string local binclock = {} @@ -82,13 +82,13 @@ local function factory(args) layout = wibox.widget.base.make_widget } - binclock.timer = gears.timer { timeout = binclock.show_seconds and 1 or 60 } - - binclock.timer:connect_signal("timeout", function() - binclock.widget:emit_signal("widget::redraw_needed") - end) - - binclock.timer:start() + binclock.timer = gears.timer { + autostart = true, + timeout = binclock.show_seconds and 1 or 60, + callback = function() + binclock.widget:emit_signal("widget::redraw_needed") + end + } return binclock end diff --git a/themes/vertex/theme.lua b/themes/vertex/theme.lua index 5746bcd..0000c51 100644 --- a/themes/vertex/theme.lua +++ b/themes/vertex/theme.lua @@ -6,10 +6,11 @@ --]] -local gears = require("gears") -local lain = require("lain") -local awful = require("awful") -local wibox = require("wibox") +local gears = require("gears") +local lain = require("lain") +local awful = require("awful") +local wibox = require("wibox") + local math, string, tag, tonumber, type, os = math, string, tag, tonumber, type, os local theme = {}