Move the Blob menu under Apps and give it icons
This commit is contained in:
@@ -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" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user