Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CI warnings #422

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apt-widget/apt-widget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ local function script_path()
return str:match("(.*/)")
end

local HOME_DIR = os.getenv("HOME")
local WIDGET_DIR = script_path()
local ICONS_DIR = WIDGET_DIR .. "/icons/"

Expand Down
2 changes: 1 addition & 1 deletion cpu-widget/cpu-widget.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local process_rows = {
}

-- Remove spaces at end and beggining of a string
function trim(s)
local function trim(s)
return (s:gsub("^%s*(.-)%s*$", "%1"))
end

Expand Down
52 changes: 31 additions & 21 deletions docker-widget/docker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ local docker_widget = wibox.widget {
}

local parse_container = function(line)
local name, id, image, how_long, size, actual_status
local name, id, image, status, how_long, size, actual_status
if string.find(line, '::Created::') then
name, id, image, size = line:match(DOCKER_CREATED_STATUS_PATTERN)
actual_status = 'Created'
Expand Down Expand Up @@ -182,14 +182,19 @@ local function worker(user_args)
status_icon:set_opacity(0.2)
status_icon:emit_signal('widget::redraw_needed')

spawn.easy_async(executable_name .. ' ' .. command .. ' ' .. container['name'], function(_, stderr)
if stderr ~= '' then show_warning(stderr) end
spawn.easy_async(string.format(LIST_CONTAINERS_CMD, executable_name, number_of_containers),
function(stdout, container_errors)
rebuild_widget(stdout, container_errors)
end)
end)
end) ) )
spawn.easy_async(executable_name .. ' ' .. command .. ' ' .. container['name'],
function(_, stderr)
if stderr ~= '' then show_warning(stderr) end
spawn.easy_async(
string.format(LIST_CONTAINERS_CMD,executable_name, number_of_containers),
function(stdout, container_errors)
rebuild_widget(stdout, container_errors)
end
)
end
)
end) )
)
else
start_stop_button = nil
end
Expand Down Expand Up @@ -241,12 +246,14 @@ local function worker(user_args)
status_icon:set_opacity(0.2)
status_icon:emit_signal('widget::redraw_needed')

awful.spawn.easy_async(executable_name .. ' ' .. command .. ' ' .. container['name'], function(_, stderr)
if stderr ~= '' then show_warning(stderr) end
spawn.easy_async(string.format(LIST_CONTAINERS_CMD, executable_name, number_of_containers),
function(stdout, container_errors)
rebuild_widget(stdout, container_errors)
end)
awful.spawn.easy_async(executable_name .. ' ' .. command .. ' ' .. container['name'],
function(_, stderr)
if stderr ~= '' then show_warning(stderr) end
spawn.easy_async(string.format(LIST_CONTAINERS_CMD,
executable_name, number_of_containers),
function(stdout, container_errors)
rebuild_widget(stdout, container_errors)
end)
end)
end) ) )
else
Expand All @@ -273,12 +280,15 @@ local function worker(user_args)
}
delete_button:buttons(
gears.table.join( awful.button({}, 1, function()
awful.spawn.easy_async(executable_name .. ' rm ' .. container['name'], function(_, rm_stderr)
if rm_stderr ~= '' then show_warning(rm_stderr) end
spawn.easy_async(string.format(LIST_CONTAINERS_CMD, executable_name, number_of_containers),
function(lc_stdout, lc_stderr)
rebuild_widget(lc_stdout, lc_stderr) end)
end)
awful.spawn.easy_async(executable_name .. ' rm ' .. container['name'],
function(_, rm_stderr)
if rm_stderr ~= '' then show_warning(rm_stderr) end
spawn.easy_async(string.format(LIST_CONTAINERS_CMD,
executable_name, number_of_containers),
function(lc_stdout, lc_stderr)
rebuild_widget(lc_stdout, lc_stderr)
end)
end)
end)))

local old_cursor, old_wibox
Expand Down
11 changes: 6 additions & 5 deletions mpris-widget/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ local function worker()
watch(string.format(GET_MPD_CMD, "'" .. default_player .. "'"), 1, update_graphic, mpris_widget)

local mpris_popup = awful.widget.watch(
"playerctl metadata --format '{{ status }}: {{ artist }} - {{ title }}\nDuration: {{ duration(position) }}/{{ duration(mpris:length) }}'",
"playerctl metadata --format '{{ status }}: {{ artist }} - {{ title }}\n"
.. "Duration: {{ duration(position) }}/{{ duration(mpris:length) }}'",
1,
function(popup, stdout)
function(callback_popup, stdout)
local metadata = stdout
if popup.visible then
popup:get_widget().text = metadata
popup:move_next_to(mouse.current_widget_geometry)
if callback_popup.visible then
callback_popup:get_widget().text = metadata
callback_popup:move_next_to(mouse.current_widget_geometry)
end
end,
awful.popup {
Expand Down
Loading