yes, I'm very commit lazy
This commit is contained in:
@@ -3,62 +3,55 @@
|
||||
------------------------------
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local dpi = require('beautiful').xresources.apply_dpi
|
||||
local gcolor = require('gears.color')
|
||||
local gfilesystem = require('gears.filesystem')
|
||||
local wibox = require('wibox')
|
||||
|
||||
-- Local libs
|
||||
local hover = require('src.tools.hover')
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = gears.filesystem.get_configuration_dir() .. "src/assets/icons/clock/"
|
||||
local icondir = gfilesystem.get_configuration_dir() .. 'src/assets/icons/clock/'
|
||||
|
||||
-- Returns the clock widget
|
||||
return function()
|
||||
|
||||
return setmetatable({}, { __call = function()
|
||||
local clock_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
{
|
||||
{
|
||||
id = "icon",
|
||||
image = gears.color.recolor_image(icondir .. "clock.svg", Theme_config.clock.fg),
|
||||
widget = wibox.widget.imagebox,
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
resize = false
|
||||
},
|
||||
id = "icon_layout",
|
||||
widget = wibox.container.place
|
||||
image = gcolor.recolor_image(icondir .. 'clock.svg', Theme_config.clock.fg),
|
||||
widget = wibox.widget.imagebox,
|
||||
valign = 'center',
|
||||
halign = 'center',
|
||||
resize = true,
|
||||
},
|
||||
id = "icon_margin",
|
||||
top = dpi(2),
|
||||
widget = wibox.container.margin
|
||||
widget = wibox.container.constraint,
|
||||
width = dpi(25),
|
||||
height = dpi(25),
|
||||
strategy = 'exact',
|
||||
},
|
||||
{
|
||||
halign = 'center',
|
||||
valign = 'center',
|
||||
format = '%H:%M',
|
||||
widget = wibox.widget.textclock,
|
||||
},
|
||||
spacing = dpi(10),
|
||||
{
|
||||
id = "label",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
format = "%H:%M",
|
||||
widget = wibox.widget.textclock
|
||||
},
|
||||
id = "clock_layout",
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
id = "container",
|
||||
left = dpi(8),
|
||||
right = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
bg = Theme_config.clock.bg,
|
||||
fg = Theme_config.clock.fg,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, dpi(6))
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
shape = Theme_config.clock.shape,
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
|
||||
Hover_signal(clock_widget)
|
||||
hover.bg_hover { widget = clock_widget }
|
||||
|
||||
return clock_widget
|
||||
end
|
||||
end, })
|
||||
|
||||
Reference in New Issue
Block a user