Give Settings its own icon and the first dock slot
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
This commit is contained in:
@@ -534,13 +534,18 @@ Singleton {
|
||||
// A "json" value: the ordered list of desktop entry ids pinned to the
|
||||
// dock. Kept in the shared store so that reordering the dock is covered
|
||||
// by Restore defaults like everything else, rather than living in its
|
||||
// own file. The shipped order is the GNOME dash it replaced.
|
||||
// own file. The shipped order is the GNOME dash it replaced, with one
|
||||
// deliberate substitution: Panama Settings takes the first slot rather
|
||||
// than GNOME Settings. 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 in the launcher.
|
||||
{
|
||||
key: "dockPinned", type: "json", group: "dock",
|
||||
label: "Pinned applications",
|
||||
detail: "Applications that stay in the Dock whether or not they are running",
|
||||
def: [
|
||||
"org.gnome.Settings", "kitty", "org.gnome.Nautilus",
|
||||
"panama-settings", "kitty", "org.gnome.Nautilus",
|
||||
"com.bitwarden.desktop", "org.gnome.Software", "helium",
|
||||
"org.mozilla.thunderbird_esr", "com.slack.Slack",
|
||||
"app.bluebubbles.BlueBubbles", "rustdesk",
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user