diff --git a/settings/hyprland.nix b/settings/hyprland.nix index e6813e1..1258ded 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -1500,13 +1500,47 @@ in objects: [modelData] } - Text { - text: modelData.name || "Unknown" - color: Theme.base04 - font.family: "FiraMono Nerd Font" - font.pixelSize: 11 - elide: Text.ElideRight + property string appIcon: { + let icon = modelData.properties["application.icon-name"] || ""; + if (icon !== "") return icon; + let name = (modelData.properties["application.name"] || modelData.name || "").toLowerCase(); + return name; + } + + Row { width: parent.width + spacing: 6 + + Item { + width: 14 + height: 14 + anchors.verticalCenter: parent.verticalCenter + visible: appIcon !== "" + + Image { + id: appStreamIcon + anchors.fill: parent + source: appIcon !== "" ? "image://icon/" + appIcon : "" + sourceSize.width: 14 + sourceSize.height: 14 + smooth: true + visible: false + } + ColorOverlay { + anchors.fill: appStreamIcon + source: appStreamIcon + color: Theme.base05 + } + } + + Text { + text: modelData.properties["application.name"] || modelData.name || "Unknown" + color: Theme.base04 + font.family: "FiraMono Nerd Font" + font.pixelSize: 11 + elide: Text.ElideRight + width: parent.width - (appIcon !== "" ? 20 : 0) + } } Row {