fix audio (hopefully last time), added new widgets(cpu/gpu/ram info), reworked the bars a bit, more stuff and fixes

This commit is contained in:
Kievits Rene
2022-05-08 01:51:44 +02:00
parent bfd342deac
commit 46d338cbaf
24 changed files with 1296 additions and 794 deletions

View File

@@ -8,75 +8,115 @@ local dpi = require("beautiful").xresources.apply_dpi
local gears = require("gears")
local wibox = require("wibox")
return function(s, widget)
return function(s, widgets)
local top_center = awful.popup {
screen = s,
widget = wibox.container.background,
ontop = false,
bg = color["Grey900"],
visible = true,
maximum_width = dpi(500),
placement = function(c) awful.placement.top(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
local top_center = awful.popup {
screen = s,
widget = wibox.container.background,
ontop = false,
bg = color["Grey900"],
visible = true,
maximum_width = dpi(500),
placement = function(c) awful.placement.top(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
top_center:struts {
top = 55
}
local function prepare_widgets(widgets)
local layout = {
forced_height = 45,
layout = wibox.layout.fixed.horizontal
}
for i, widget in pairs(widgets) do
if i == 1 then
table.insert(layout,
{
widget,
left = dpi(6),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
elseif i == #widgets then
table.insert(layout,
{
widget,
left = dpi(3),
right = dpi(6),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
else
table.insert(layout,
{
widget,
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
end
end
return layout
end
top_center:setup {
nil,
{
widget,
margins = dpi(6),
widget = wibox.container.margin
},
nil,
forced_height = 45,
layout = wibox.layout.align.horizontal
}
top_center:setup {
nil,
prepare_widgets(widgets),
nil,
layout = wibox.layout.fixed.horizontal
}
client.connect_signal(
"manage",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
client.connect_signal(
"manage",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
client.connect_signal(
"unmanage",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
client.connect_signal(
"unmanage",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
client.connect_signal(
"tag::switched",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
client.connect_signal(
"tag::switched",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
awesome.connect_signal(
"refresh",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
awesome.connect_signal(
"refresh",
function(c)
if #s.selected_tag:clients() < 1 then
top_center.visible = false
else
top_center.visible = true
end
end
)
end

View File

@@ -10,285 +10,289 @@ local wibox = require("wibox")
return function(screen, programs)
local function create_dock_element(class, program, name, is_steam, size)
if program == nil or class == nil then
return
end
is_steam = is_steam or false
local dock_element = wibox.widget {
{
{
{
resize = true,
forced_width = size,
forced_height = size,
image = Get_icon(user_vars.icon_theme, nil, program, class, is_steam),
widget = wibox.widget.imagebox,
id = "icon"
},
margins = dpi(5),
widget = wibox.container.margin,
id = "margin"
},
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end,
bg = color["Grey900"],
widget = wibox.container.background,
id = "background"
},
top = dpi(5),
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin
}
for k, c in ipairs(client.get()) do
if string.lower(c.class):match(program) and c == client.focus then
dock_element.background.bg = color["Grey800"]
end
end
Hover_signal(dock_element.background, color["Grey800"], color["White"])
dock_element:connect_signal(
"button::press",
function()
if is_steam then
awful.spawn("steam steam://rungameid/" .. program)
else
awful.spawn(program)
end
end
)
awful.tooltip {
objects = { dock_element },
text = name,
mode = "outside",
preferred_alignments = "middle",
margins = dpi(10)
}
return dock_element
local function create_dock_element(class, program, name, is_steam, size)
if program == nil or class == nil then
return
end
is_steam = is_steam or false
local dock = awful.popup {
widget = wibox.container.background,
ontop = true,
bg = color["Grey900"],
visible = true,
screen = screen,
type = "dock",
height = user_vars.dock_icon_size + 10,
placement = function(c) awful.placement.bottom(c, { margins = dpi(10) }) end,
local dock_element = wibox.widget {
{
{
{
resize = true,
forced_width = size,
forced_height = size,
image = Get_icon(user_vars.icon_theme, nil, program, class, is_steam),
widget = wibox.widget.imagebox,
id = "icon"
},
margins = dpi(5),
widget = wibox.container.margin,
id = "margin"
},
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 15)
end
}
local fakedock = awful.popup {
gears.shape.rounded_rect(cr, width, height, 10)
end,
bg = color["Grey900"],
widget = wibox.container.background,
ontop = true,
bg = '#00000000',
visible = true,
screen = screen,
type = "dock",
id = "fakedock",
height = dpi(10),
placement = function(c) awful.placement.bottom(c, { margins = dpi(0) }) end,
id = "background"
},
top = dpi(5),
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin
}
local function get_dock_elements(pr)
local dock_elements = { layout = wibox.layout.fixed.horizontal }
for i, p in ipairs(pr) do
dock_elements[i] = create_dock_element(p[1], p[2], p[3], p[4], user_vars.dock_icon_size)
end
return dock_elements
for k, c in ipairs(client.get()) do
if string.lower(c.class):match(program) and c == client.focus then
dock_element.background.bg = color["Grey800"]
end
end
local dock_elements = get_dock_elements(programs)
Hover_signal(dock_element.background, color["Grey800"], color["White"])
local function get_fake_elements(amount)
local fake_elements = { layout = wibox.layout.fixed.horizontal }
for i = 0, amount, 1 do
fake_elements[i] = wibox.widget {
bg = '00000000',
forced_width = user_vars.dock_icon_size + dpi(20),
forced_height = dpi(10),
id = "fake",
widget = wibox.container.background
}
end
return fake_elements
dock_element:connect_signal(
"button::press",
function()
if is_steam then
awful.spawn("steam steam://rungameid/" .. program)
else
awful.spawn(program)
end
end
)
local function create_incicator_widget(prog)
local container = { layout = wibox.layout.flex.horizontal }
local clients = client.get()
for index, pr in ipairs(prog) do
local indicators = { layout = wibox.layout.flex.horizontal, spacing = dpi(5) }
local col = color["Grey600"]
for i, c in ipairs(clients) do
if string.lower(c.class or c.name):match(string.lower(pr[1]) or string.lower(pr[2])) then
if c == client.focus then
col = color["YellowA200"]
elseif c.urgent then
col = color["RedA200"]
elseif c.maximized then
col = color["GreenA200"]
elseif c.minimized then
col = color["BlueA200"]
elseif c.fullscreen then
col = color["PinkA200"]
else
col = color["Grey600"]
end
indicators[i] = wibox.widget {
widget = wibox.container.background,
shape = gears.shape.rounded_rect,
forced_height = dpi(3),
bg = col,
forced_width = dpi(5),
}
end
end
container[index] = wibox.widget {
indicators,
forced_height = dpi(5),
forced_width = dpi(50),
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin,
}
end
return wibox.widget {
container,
bottom = dpi(5),
widget = wibox.container.margin,
}
end
fakedock:setup {
get_fake_elements(#programs),
type = 'dock',
layout = wibox.layout.fixed.vertical
awful.tooltip {
objects = { dock_element },
text = name,
mode = "outside",
preferred_alignments = "middle",
margins = dpi(10)
}
local function check_for_dock_hide(s)
local naughty = require("naughty")
if #s.selected_tag:clients() < 1 then
dock.visible = true
return
return dock_element
end
local dock = awful.popup {
widget = wibox.container.background,
ontop = true,
bg = color["Grey900"],
visible = true,
screen = screen,
type = "dock",
height = user_vars.dock_icon_size + 10,
placement = function(c) awful.placement.bottom(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 15)
end
}
local fakedock = awful.popup {
widget = wibox.container.background,
ontop = true,
bg = '#00000000',
visible = true,
screen = screen,
type = "dock",
id = "fakedock",
height = dpi(10),
placement = function(c) awful.placement.bottom(c, { margins = dpi(0) }) end,
}
local function get_dock_elements(pr)
local dock_elements = { layout = wibox.layout.fixed.horizontal }
for i, p in ipairs(pr) do
dock_elements[i] = create_dock_element(p[1], p[2], p[3], p[4], user_vars.dock_icon_size)
end
return dock_elements
end
local dock_elements = get_dock_elements(programs)
local function get_fake_elements(amount)
local fake_elements = { layout = wibox.layout.fixed.horizontal }
for i = 0, amount, 1 do
fake_elements[i] = wibox.widget {
bg = '00000000',
forced_width = user_vars.dock_icon_size + dpi(20),
forced_height = dpi(10),
id = "fake",
widget = wibox.container.background
}
end
return fake_elements
end
local function create_incicator_widget(prog)
local container = { layout = wibox.layout.flex.horizontal }
local clients = client.get()
for index, pr in ipairs(prog) do
local indicators = { layout = wibox.layout.flex.horizontal, spacing = dpi(5) }
local col = color["Grey600"]
for i, c in ipairs(clients) do
if string.lower(c.class or c.name):match(string.lower(pr[1]) or string.lower(pr[2])) then
if c == client.focus then
col = color["YellowA200"]
elseif c.urgent then
col = color["RedA200"]
elseif c.maximized then
col = color["GreenA200"]
elseif c.minimized then
col = color["BlueA200"]
elseif c.fullscreen then
col = color["PinkA200"]
else
col = color["Grey600"]
end
indicators[i] = wibox.widget {
widget = wibox.container.background,
shape = gears.shape.rounded_rect,
forced_height = dpi(3),
bg = col,
forced_width = dpi(5),
}
end
if s == mouse.screen then
--[[ if mouse.current_widget then
end
container[index] = wibox.widget {
indicators,
forced_height = dpi(5),
forced_width = dpi(50),
left = dpi(5),
right = dpi(5),
widget = wibox.container.margin,
}
end
return wibox.widget {
container,
bottom = dpi(5),
widget = wibox.container.margin,
}
end
fakedock:setup {
get_fake_elements(#programs),
type = 'dock',
layout = wibox.layout.fixed.vertical
}
local function check_for_dock_hide(s)
local naughty = require("naughty")
if #s.selected_tag:clients() < 1 then
dock.visible = true
return
end
if s == mouse.screen then
--[[ if mouse.current_widget then
if tostring(mouse.current_widget):match("fake") then
dock.visible = true
return
end
end ]]
local visible = false
for j, c in ipairs(s.selected_tag:clients()) do
local visible = false
for j, c in ipairs(s.selected_tag:clients()) do
--naughty.notify({ title = tostring(c.class) })
if c.maximized or c.fullscreen then
dock.visible = false
return
end
local y = c:geometry().y
local h = c.height
if (y + h) >= s.geometry.height - user_vars.dock_icon_size - 35 then
dock.visible = false
return
else
dock.visible = true
end
--[[ if visible then
--naughty.notify({ title = tostring(c.class) })
if c.maximized or c.fullscreen then
dock.visible = false
return
end
local y = c:geometry().y
local h = c.height
if (y + h) >= s.geometry.height - user_vars.dock_icon_size - 35 then
dock.visible = false
return
else
dock.visible = true
end
--[[ if visible then
dock.visible = visible
return
end ]]
end
else
dock.visible = false
end
end
else
dock.visible = false
end
end
local dock_intelligent_hide = gears.timer {
timeout = 1,
autostart = true,
call_now = true,
callback = function()
check_for_dock_hide(screen)
end
}
local dock_intelligent_hide = gears.timer {
timeout = 1,
autostart = true,
call_now = true,
callback = function()
check_for_dock_hide(screen)
end
}
fakedock:connect_signal(
"mouse::enter",
function()
dock_intelligent_hide:stop()
dock.visible = true
end
)
client.connect_signal(
"manage",
function()
check_for_dock_hide(screen)
dock:setup {
dock_elements,
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end
)
client.connect_signal(
"unmanage",
function()
check_for_dock_hide(screen)
dock:setup {
dock_elements,
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end
)
client.connect_signal(
"focus",
function()
check_for_dock_hide(screen)
dock:setup {
dock_elements,
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end
)
dock:connect_signal(
"mouse::enter",
function()
dock_intelligent_hide:stop()
end
)
dock:connect_signal(
"mouse::leave",
function()
dock_intelligent_hide:again()
end
)
fakedock:connect_signal(
"mouse::enter",
function()
for index, c in ipairs(screen.clients) do
if not c.fullscreen then
dock_intelligent_hide:stop()
dock.visible = true
end
end
end
)
client.connect_signal(
"manage",
function()
check_for_dock_hide(screen)
dock:setup {
get_dock_elements(programs),
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
dock_elements,
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end
)
client.connect_signal(
"unmanage",
function()
check_for_dock_hide(screen)
dock:setup {
dock_elements,
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end
)
client.connect_signal(
"focus",
function()
check_for_dock_hide(screen)
dock:setup {
dock_elements,
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end
)
dock:connect_signal(
"mouse::enter",
function()
dock_intelligent_hide:stop()
end
)
dock:connect_signal(
"mouse::leave",
function()
dock_intelligent_hide:again()
end
)
dock:setup {
get_dock_elements(programs),
create_incicator_widget(programs),
layout = wibox.layout.fixed.vertical
}
end

View File

@@ -8,56 +8,55 @@ awful.screen.connect_for_each_screen(
-- For each screen this function is called once
-- If you want to change the modules per screen use the indices
-- e.g. 1 would be the primary screen and 2 the secondary screen.
function(s)
-- Create 9 tags
awful.layout.layouts = user_vars.layouts
awful.tag(
{ "1", "2", "3", "4", "5", "6", "7", "8", "9" },
s,
user_vars.layouts[1]
)
function(s)
-- Create 9 tags
awful.layout.layouts = user_vars.layouts
awful.tag(
{ "1", "2", "3", "4", "5", "6", "7", "8", "9" },
s,
user_vars.layouts[1]
)
require("src.modules.powermenu")(s)
-- TODO: rewrite calendar osd, maybe write an own inplementation
-- require("src.modules.calendar_osd")(s)
require("src.modules.volume_osd")(s)
require("src.modules.brightness_osd")(s)
require("src.modules.titlebar")
require("src.modules.powermenu")(s)
-- TODO: rewrite calendar osd, maybe write an own inplementation
-- require("src.modules.calendar_osd")(s)
require("src.modules.volume_osd")(s)
require("src.modules.brightness_osd")(s)
require("src.modules.titlebar")
require("src.modules.volume_controller")(s)
-- Widgets
s.battery = require("src.widgets.battery")()
s.network = require("src.widgets.network")()
s.audio = require("src.widgets.audio")()
s.date = require("src.widgets.date")()
s.clock = require("src.widgets.clock")()
s.bluetooth = require("src.widgets.bluetooth")()
s.layoutlist = require("src.widgets.layout_list")()
s.powerbutton = require("src.widgets.power")()
s.kblayout = require("src.widgets.kblayout")(s)
s.taglist = require("src.widgets.taglist")(s)
s.tasklist = require("src.widgets.tasklist")(s)
s.systray = require("src.widgets.systray")(s)
-- Widgets
s.battery = require("src.widgets.battery")()
s.network = require("src.widgets.network")()
s.audio = require("src.widgets.audio")()
s.date = require("src.widgets.date")()
s.clock = require("src.widgets.clock")()
s.bluetooth = require("src.widgets.bluetooth")()
s.layoutlist = require("src.widgets.layout_list")()
s.powerbutton = require("src.widgets.power")()
s.kblayout = require("src.widgets.kblayout")(s)
s.taglist = require("src.widgets.taglist")(s)
s.tasklist = require("src.widgets.tasklist")(s)
s.systray = require("src.widgets.systray")(s)
s.cpu_usage = require("src.widgets.cpu_info")("usage")
s.cpu_temp = require("src.widgets.cpu_info")("temp")
s.cpu_freq = require("src.widgets.cpu_info")("freq", "average")
s.ram_info = require("src.widgets.ram_info")()
s.gpu_usage = require("src.widgets.gpu_info")("usage")
s.gpu_temp = require("src.widgets.gpu_info")("temp")
-- Add more of these if statements if you want to change
-- the modules/widgets per screen.
if s.index == 1 then
require("crylia_bar.left_bar")(s, { s.layoutlist, s.systray, s.taglist })
require("crylia_bar.center_bar")(s, { s.tasklist })
require("crylia_bar.right_bar")(s, { s.gpu_usage, s.gpu_temp, s.cpu_usage, s.cpu_temp, s.audio, s.kblayout, s.date, s.clock, s.powerbutton })
require("crylia_bar.dock")(s, user_vars.dock_programs)
end
-- Add more of these if statements if you want to change
-- the modules/widgets per screen.
-- uncomment this example and dont forget to remove/comment the other code below
--[[ if s.index == 1 then
require("crylia_bar.left_bar")(s, {s.layoutlist, s.systray, s.taglist})
require("crylia_bar.center_bar")(s, s.tasklist)
require("crylia_bar.right_bar")(s, {s.date, s.clock,s.powerbutton})
require("crylia_bar.dock")(s, user_vars.dock_programs)
end ]]
--[[ if s.index == 2 then
require("crylia_bar.left_bar")(s, {s.layoutlist, s.systray, s.taglist})
require("crylia_bar.center_bar")(s, s.tasklist)
require("crylia_bar.right_bar")(s, {s.battery, s.network, s.bluetooth, s.audio, s.kblayout, s.date, s.clock,s.powerbutton})
end ]]
-- Bars
require("crylia_bar.left_bar")(s, { s.layoutlist, s.systray, s.taglist })
require("crylia_bar.center_bar")(s, s.tasklist)
require("crylia_bar.right_bar")(s, { s.battery, s.network, s.bluetooth, s.audio, s.kblayout, s.date, s.clock, s.powerbutton })
require("crylia_bar.dock")(s, user_vars.dock_programs)
end
if s.index == 2 then
require("crylia_bar.left_bar")(s, { s.layoutlist, s.taglist })
require("crylia_bar.center_bar")(s, { s.tasklist })
require("crylia_bar.right_bar")(s, { s.ram_info, s.audio, s.kblayout, s.network, s.date, s.clock, s.powerbutton })
end
end
)

View File

@@ -10,54 +10,68 @@ local wibox = require("wibox")
return function(s, widgets)
local top_left = awful.popup {
screen = s,
widget = wibox.container.background,
ontop = false,
bg = color["Grey900"],
visible = true,
maximum_width = dpi(650),
placement = function(c) awful.placement.top_left(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
local top_left = awful.popup {
screen = s,
widget = wibox.container.background,
ontop = false,
bg = color["Grey900"],
visible = true,
maximum_width = dpi(650),
placement = function(c) awful.placement.top_left(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
top_left:struts {
top = 55
}
top_left:struts {
top = 55
}
top_left:setup {
{
{
widgets[1],
left = dpi(6),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[2],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[3],
left = dpi(3),
right = dpi(6),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
forced_height = 45,
layout = wibox.layout.fixed.horizontal
},
nil,
nil,
layout = wibox.layout.fixed.horizontal
local function prepare_widgets(widgets)
local layout = {
forced_height = 45,
layout = wibox.layout.fixed.horizontal
}
for i, widget in pairs(widgets) do
if i == 1 then
table.insert(layout,
{
widget,
left = dpi(6),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
elseif i == #widgets then
table.insert(layout,
{
widget,
left = dpi(3),
right = dpi(6),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
else
table.insert(layout,
{
widget,
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
end
end
return layout
end
top_left:setup {
prepare_widgets(widgets),
nil,
nil,
layout = wibox.layout.fixed.horizontal
}
end

View File

@@ -10,89 +10,67 @@ local wibox = require("wibox")
return function(s, widgets)
local top_right = awful.popup {
widget = wibox.container.background,
ontop = false,
bg = color["Grey900"],
visible = true,
screen = s,
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
local top_right = awful.popup {
widget = wibox.container.background,
ontop = false,
bg = color["Grey900"],
visible = true,
screen = s,
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end,
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 5)
end
}
top_right:setup {
nil,
nil,
{
{
widgets[1],
left = dpi(6),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[2],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[3],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[4],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[5],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[6],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[7],
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
{
widgets[8],
left = dpi(3),
right = dpi(6),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
},
forced_height = 45,
layout = wibox.layout.fixed.horizontal
},
layout = wibox.layout.align.horizontal
top_right:struts {
top = 55
}
local function prepare_widgets(widgets)
local layout = {
forced_height = 45,
layout = wibox.layout.fixed.horizontal
}
for i, widget in pairs(widgets) do
if i == 1 then
table.insert(layout,
{
widget,
left = dpi(6),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
elseif i == #widgets then
table.insert(layout,
{
widget,
left = dpi(3),
right = dpi(6),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
else
table.insert(layout,
{
widget,
left = dpi(3),
right = dpi(3),
top = dpi(6),
bottom = dpi(6),
widget = wibox.container.margin
})
end
end
return layout
end
top_right:setup {
nil,
nil,
prepare_widgets(widgets),
layout = wibox.layout.align.horizontal
}
end