From 19311e2d673d3e02a46e1c143c26b3837a7e1af4 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 20 Aug 2017 20:21:25 -0300 Subject: Cleanup --- .../awesome.link/themes/xoria256/binclock.lua | 96 ---------------------- config.dot/awesome.link/themes/xoria256/theme.lua | 9 +- 2 files changed, 2 insertions(+), 103 deletions(-) delete mode 100644 config.dot/awesome.link/themes/xoria256/binclock.lua diff --git a/config.dot/awesome.link/themes/xoria256/binclock.lua b/config.dot/awesome.link/themes/xoria256/binclock.lua deleted file mode 100644 index ef620af..0000000 --- a/config.dot/awesome.link/themes/xoria256/binclock.lua +++ /dev/null @@ -1,96 +0,0 @@ - ---[[ - - Licensed under GNU General Public License v2 - * (c) 2017, Luke Bonham - * (c) 2013, romockee - ---]] - -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 = {} - -function binclock.dec2bin(num, bits) - local bits, t = bits or select(2, math.frexp(num)), {} - for b = bits, 1, -1 do - t[b] = math.fmod(num, 2) - num = (num - t[b]) / 2 - end - return t -end - -function binclock.paintdot(cr, val, shift) - local height = 0 - for _, bit in ipairs(binclock.dec2bin(val, 4)) do - if bit >= 1 then - cr:set_source(gears.color(binclock.color_active)) - else - cr:set_source(gears.color(binclock.color_inactive)) - end - cr:rectangle(shift, height, binclock.dotsize, binclock.dotsize) - cr:fill() - height = height + binclock.dotsize + binclock.step - end -end - -local function factory(args) - local args = args or {} - - binclock.width = args.width or 42 - binclock.height = args.height or 18 - binclock.show_seconds = args.show_seconds or false - binclock.color_active = args.color_active or "#CCCCCC" - binclock.color_inactive = args.color_inactive or "#444444" - binclock.dotsize = math.floor(binclock.height / 5) - binclock.step = math.floor(binclock.dotsize / 3) - - binclock.widget = wibox.widget { - fit = function(self, context, width, height) - return binclock.width, binclock.height - end, - draw = function(self, context, cr, width, height) - local t = date("*t") - - local hour = string.format("%02d", t.hour) - local min = string.format("%02d", t.min) - local sec = string.format("%02d", t.sec) - - local col_count = 4 - if binclock.show_seconds then - col_count = 6 - end - local step = math.floor((binclock.width - col_count * binclock.dotsize) / 8) - - binclock.paintdot(cr, string.sub(hour, 1, 1), step, 2) - binclock.paintdot(cr, string.sub(hour, 2, 2), binclock.dotsize + 2 * step) - - binclock.paintdot(cr, string.sub(min, 1, 1), binclock.dotsize * 2 + 4 * step) - binclock.paintdot(cr, string.sub(min, 2, 2), binclock.dotsize * 3 + 5 * step) - - if binclock.show_seconds then - binclock.paintdot(cr, string.sub(sec, 1, 1), binclock.dotsize * 4 + 7 * step) - binclock.paintdot(cr, string.sub(sec, 2, 2), binclock.dotsize * 5 + 8 * step) - end - end, - layout = wibox.widget.base.make_widget - } - - 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 - -return factory diff --git a/config.dot/awesome.link/themes/xoria256/theme.lua b/config.dot/awesome.link/themes/xoria256/theme.lua index 7a69749..eed6077 100644 --- a/config.dot/awesome.link/themes/xoria256/theme.lua +++ b/config.dot/awesome.link/themes/xoria256/theme.lua @@ -1,10 +1,5 @@ - ---[[ - - xoria256 Awesome WM theme - based on powerarrow from github.com/copycat-killer - ---]] +-- xoria256 Awesome WM theme +-- based on powerarrow from github.com/copycat-killer --local gears = require("gears") --local lain = require("lain") -- cgit v1.2.3