Panama Settings shipped with Icon=preferences-system-symbolic, a monochrome glyph drawn for 16px toolbar use. Beside full-colour application icons in a 48px dock it reads as a missing icon rather than a quiet one. It now has its own: a gear, because a settings icon has to be recognisable before it is clever, rendered in the Prism gradient on the dark tile so it belongs to this desktop. An earlier attempt drew the gear as a ring with radial strokes; at dock size the strokes merged into the ring and it read as an X. The shipped version is a real toothed outline, checked at 48px rather than only at 128. The dock also pinned GNOME Settings first. Panama now covers what GNOME Settings did for this desktop and delegates the remainder to it by name, so pinning the thing it delegates TO put the fallback in front of the real one. GNOME Settings stays installed and searchable. link-dotfiles installs icons alongside desktop entries, so this survives a fresh setup rather than being a file that happens to exist here. The new contract asserts every pinned application resolves to an installed desktop entry. DockBody drops an unresolvable pin rather than drawing a broken icon, which is right at runtime and invisible to debug: a typo or a renamed desktop id just removes an icon with nothing logged. It also cost me a false negative while writing it -- DesktopEntries populates asynchronously, and asking too early reports every pin as missing. Also makes tests/quickshell/osd-ui-contract.sh executable. It was committed mode 644, the only test in the suite that was, so the runner could not invoke it. It passes. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
36 lines
1.2 KiB
QML
36 lines
1.2 KiB
QML
import Quickshell
|
|
import Quickshell.Io
|
|
import QtQuick
|
|
import qs.config
|
|
|
|
ShellRoot {
|
|
// DesktopEntries populates asynchronously. Reading `applications.values`
|
|
// here rather than calling byId() blind is the documented way to wait for
|
|
// it -- and is exactly the trap noted in modules/settings/README.md.
|
|
readonly property var ids: {
|
|
const out = {};
|
|
for (const entry of DesktopEntries.applications.values)
|
|
out[entry.id] = entry;
|
|
return out;
|
|
}
|
|
|
|
IpcHandler {
|
|
target: "dock-pin-test"
|
|
|
|
function count(): int { return DesktopEntries.applications.values.length; }
|
|
|
|
function resolve(): string {
|
|
const pinned = DesktopPreferences.get("dockPinned");
|
|
const missing = [];
|
|
let first = null;
|
|
for (const id of pinned) {
|
|
const entry = DesktopEntries.byId(id);
|
|
if (!entry) missing.push(id);
|
|
if (first === null)
|
|
first = { id: id, found: !!entry, name: entry ? entry.name : "", icon: entry ? entry.icon : "" };
|
|
}
|
|
return JSON.stringify({ total: pinned.length, first: first, missing: missing });
|
|
}
|
|
}
|
|
}
|