Skip to content

Commit

Permalink
menubar.menu_gen: add category other
Browse files Browse the repository at this point in the history
  • Loading branch information
HoNamDuong committed Feb 6, 2024
1 parent e6f5c79 commit 2cd1ad0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/menubar/menu_gen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ menu_gen.all_categories = {
tools = { app_type = "System", name = "System Tools",
icon_name = "applications-system", use = true },
utility = { app_type = "Utility", name = "Accessories",
icon_name = "applications-accessories", use = true }
icon_name = "applications-accessories", use = true },
other = { app_type = nil, name = "Other",
icon_name = "applications-other", use = true }
}

-- Find icons for category entries.
Expand Down Expand Up @@ -101,6 +103,7 @@ function menu_gen.generate(callback)
-- Check if the program falls into at least one of the
-- usable categories. Set target_category to be the id
-- of the first category it finds.
-- Or without category.
if entry.categories then
for _, category in pairs(entry.categories) do
local cat_key, cat_use =
Expand All @@ -110,6 +113,8 @@ function menu_gen.generate(callback)
break
end
end
else
target_category = "other"

Check warning on line 117 in lib/menubar/menu_gen.lua

View check run for this annotation

Codecov / codecov/patch

lib/menubar/menu_gen.lua#L117

Added line #L117 was not covered by tests
end

local name = utils.rtrim(entry.Name) or ""
Expand Down

0 comments on commit 2cd1ad0

Please sign in to comment.