--- a/modules/bar/components/ActiveWindow.qml +++ b/modules/bar/components/ActiveWindow.qml @@ -1,6 +1,7 @@ pragma ComponentBehavior: Bound import QtQuick +import Quickshell import Caelestia.Config import Caelestia.I18n import qs.components @@ -19,6 +20,15 @@ if (!title) return Tr.trCtx("Desktop", "shown when no window is focused"); if (Config.bar.activeWindow.compact) { + // NixDaemon: show the program, not the window title. The desktop + // entry's name for the window class, else the class itself, else + // the last " - " segment of the title as upstream does. + const cls = Hypr.activeToplevel?.lastIpcObject.class; + const entry = cls ? DesktopEntries.heuristicLookup(cls) : null; + if (entry?.name) + return entry.name; + if (cls) + return cls; // " - " (standard hyphen), " — " (em dash), " – " (en dash) const parts = title.split(/\s+[\-\u2013\u2014]\s+/); if (parts.length > 1)