2022-07-16 14:13:03 -07:00
|
|
|
local util = {}
|
|
|
|
|
|
|
|
util.mpc_command = function(command, callback)
|
|
|
|
awful.spawn.easy_async(
|
2022-07-16 19:06:55 -07:00
|
|
|
"mpc --host " .. config.mpc.host .. " " .. command,
|
2022-07-16 14:13:03 -07:00
|
|
|
callback
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
util.mpc_watch = function(command, timeout, callback, widget)
|
|
|
|
awful.widget.watch(
|
2022-07-16 19:06:55 -07:00
|
|
|
"mpc --host " .. config.mpc.host .. " " .. command,
|
2022-07-16 14:13:03 -07:00
|
|
|
timeout,
|
|
|
|
callback,
|
|
|
|
widget
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
return util
|