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