Move the Blob menu under Apps and give it icons

This commit is contained in:
2026-08-21 14:49:13 -04:00
parent d0d23fb806
commit a51586fce4
2 changed files with 29 additions and 6 deletions
+5 -5
View File
@@ -2,9 +2,9 @@
// Blob entries added to the Quickshell Omarchy menu (Super + Space). // Blob entries added to the Quickshell Omarchy menu (Super + Space).
// These replace the walker/elephant menus used before Omarchy 4. // These replace the walker/elephant menus used before Omarchy 4.
"blob": { "icon": "", "label": "Blob" }, "blob": { "icon": "󰖌", "label": "Blob", "before": "learn" },
"blob.wallpaper": { "icon": "", "label": "Wallpaper", "action": "blob_wallpaper --menu", "description": "Pick a wallpaper from ~/wallpapers" }, "blob.wallpaper": { "icon": "󰸉", "label": "Wallpaper", "action": "blob_wallpaper --menu", "description": "Pick a wallpaper from ~/wallpapers" },
"blob.theme": { "icon": "", "label": "Theme", "action": "blob_theme --menu", "description": "Pick a local or Omarchy color theme" }, "blob.theme": { "icon": "󰢵", "label": "Theme", "action": "blob_theme --menu", "description": "Pick a local or Omarchy color theme" },
"blob.dynamic": { "icon": "", "label": "Dynamic theme", "action": "blob_theme --dynamic", "description": "Recolor from the current wallpaper" }, "blob.dynamic": { "icon": "󰁨", "label": "Dynamic theme", "action": "blob_theme --dynamic", "description": "Recolor from the current wallpaper" },
"blob.glass": { "icon": "", "label": "Toggle glass", "action": "blob_glass toggle", "checked": "test -f $HOME/.local/state/omarchy/toggles/hypr/blob-glass.lua" } "blob.glass": { "icon": "󱡓", "label": "Toggle glass", "action": "blob_glass toggle", "checked": "test -f $HOME/.local/state/omarchy/toggles/hypr/blob-glass.lua" }
} }
+24 -1
View File
@@ -23,6 +23,7 @@ function normalizeItem(id, raw) {
return { return {
id: id, id: id,
parent: parent, parent: parent,
before: value.before || "",
kind: kind, kind: kind,
icon: value.icon || "", icon: value.icon || "",
iconFont: value.iconFont || "", iconFont: value.iconFont || "",
@@ -62,6 +63,26 @@ function parseMenuJsonc(raw) {
return out return out
} }
// A row may name a sibling's id in `before:` to sit ahead of it. User rows are
// appended after every default row, so without this a new top-level entry can
// only land at the bottom of the root menu.
function applyBeforeHints(items, itemOrder) {
var order = itemOrder.slice()
for (var i = 0; i < itemOrder.length; i++) {
var entry = items[itemOrder[i]]
if (!entry || !entry.before) continue
var entryIndex = order.indexOf(entry.id)
if (entryIndex < 0 || order.indexOf(entry.before) < 0) continue
order.splice(entryIndex, 1)
order.splice(order.indexOf(entry.before), 0, entry.id)
}
return order
}
function mergeMenuSources(defaultItems, userItems) { function mergeMenuSources(defaultItems, userItems) {
var nextItems = ({}) var nextItems = ({})
var nextOrder = [] var nextOrder = []
@@ -82,8 +103,10 @@ function mergeMenuSources(defaultItems, userItems) {
} }
} }
nextOrder = applyBeforeHints(nextItems, nextOrder)
if (!nextItems.root) { if (!nextItems.root) {
nextItems.root = { id: "root", parent: "", kind: "menu", icon: "", iconFont: "", label: "Go", title: "", target: "", description: "", aliases: [], when: "", checked: "", action: "", provider: "" } nextItems.root = { id: "root", parent: "", before: "", kind: "menu", icon: "", iconFont: "", label: "Go", title: "", target: "", description: "", aliases: [], when: "", checked: "", action: "", provider: "" }
nextOrder.unshift("root") nextOrder.unshift("root")
} }
for (var k3 = 0; k3 < nextOrder.length; k3++) nextItems[nextOrder[k3]].order = k3 for (var k3 = 0; k3 < nextOrder.length; k3++) nextItems[nextOrder[k3]].order = k3