More cleanup

master
Mark 2022-07-16 17:18:27 -07:00
parent f25ff7f8c2
commit 7d1a0b6155
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
8 changed files with 18 additions and 16 deletions

View File

@ -1,4 +1,7 @@
return {
-- When everything is ready, call core.start()
start = require("core.start")
start = require("core.start"),
-- Utilities
sound = require("core.sound")
}

View File

@ -2,11 +2,11 @@ local function start()
local desktop = {
widgets = {
tasklist = require("core.tasklist"),
textclock = require("core.textclock"),
textclock = modules.simple_widgets.textclock,
keymap = modules.ibus.widgets.ibus,
volume = modules.volume.widgets.volume,
launcher = modules.launcher.widgets.launcher,
shortcut = require("core.shortcut"),
shortcut = modules.simple_widgets.make_shortcut,
space = function(size)
return wibox.widget {
@ -141,7 +141,7 @@ local function start()
desktop.widgets.space(6)
}
for k, v in pairs(conf.bar_shortcuts) do
s.shortcuts[#s.shortcuts + 1] = desktop.widgets.shortcut:new(v[1], v[2])
s.shortcuts[#s.shortcuts + 1] = desktop.widgets.shortcut(v[1], v[2])
end
end

View File

@ -0,0 +1,4 @@
return {
textclock = require("modules.simple_widgets.textclock").widget,
make_shortcut = require("modules.simple_widgets.shortcut")
}

View File

@ -1,6 +1,4 @@
local shortcuts = {}
function shortcuts:new(command, icon)
local function make_shortcut(command, icon)
local widget = wibox.widget {
{
{ -- Right space
@ -48,4 +46,4 @@ function shortcuts:new(command, icon)
return widget
end
return shortcuts
return make_shortcut

View File

@ -1,7 +1,5 @@
local textclock = {}
textclock.widget = wibox.widget {
{
{ -- Right spacer
@ -45,4 +43,4 @@ textclock.widget:connect_signal("mouse::leave", function(result)
textclock.widget.bg = beautiful.color.transparent
end)
return textclock.widget
return textclock

View File

@ -81,7 +81,7 @@ volume.volume_up = function()
end
volume.commands:up()
Sound.play("volume_up")
core.sound.play("volume_up")
volume.exec_hooks()
end
@ -92,7 +92,7 @@ volume.volume_down = function()
end
volume.commands:down()
Sound.play("volume_down")
core.sound.play("volume_down")
volume.exec_hooks()
end

5
rc.lua
View File

@ -38,8 +38,6 @@ beautiful.init(require("theme"))
core = require("core")
Sound = require("sound")
-- Load key bindings
local binds = require("binds")
local keys = binds.keys
@ -51,7 +49,8 @@ for k, v in ipairs({
"mpc",
"ibus",
"volume",
"launcher"
"launcher",
"simple_widgets"
}) do
modules[v] = require("modules." .. v)