bar: active window show class in tooltip

This commit is contained in:
2 * r + 2 * t 2025-01-16 12:21:56 +11:00
parent f2945d0715
commit b825e97639

View file

@ -41,8 +41,12 @@ const ActiveWindow = () => (
hasTooltip hasTooltip
className="module active-window" className="module active-window"
setup={self => { setup={self => {
const title = Variable(hyprland.focusedClient?.title ?? ""); const title = Variable("");
hookFocusedClientProp(self, "title", c => title.set(c?.title ?? "")); const updateTooltip = (c: AstalHyprland.Client | null) =>
title.set(c?.class && c?.title ? `${c.class}: ${c.title}` : "");
hookFocusedClientProp(self, "class", updateTooltip);
hookFocusedClientProp(self, "title", updateTooltip);
updateTooltip(hyprland.focusedClient);
const window = setupCustomTooltip(self, bind(title)); const window = setupCustomTooltip(self, bind(title));
if (window) { if (window) {