From 58b700ed0d401ac33560c795b23aaf14e532c2dc Mon Sep 17 00:00:00 2001 From: Marcin Jahn <10273406+marcinjahn@users.noreply.github.com> Date: Tue, 10 Mar 2026 15:49:28 +0100 Subject: [PATCH] fix(shell): cover edge cases of compact focused app widget (#1918) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes two cases: - some apps (e.g., Zen browser use the "—" character at the end of webpage name) - in compact mode, when app has only appName, and not window name, we should display the appName to avoid empty title. --- quickshell/Modules/DankBar/Widgets/FocusedApp.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/quickshell/Modules/DankBar/Widgets/FocusedApp.qml b/quickshell/Modules/DankBar/Widgets/FocusedApp.qml index 5a460af6..c0446311 100644 --- a/quickshell/Modules/DankBar/Widgets/FocusedApp.qml +++ b/quickshell/Modules/DankBar/Widgets/FocusedApp.qml @@ -211,16 +211,17 @@ BasePill { text: { const title = activeWindow && activeWindow.title ? activeWindow.title : ""; const appName = appText.text; + + if (compactMode && title === appName) { + return title; + } + if (!title || !appName) { return title; } - if (title.endsWith(" - " + appName)) { - return title.substring(0, title.length - (" - " + appName).length); - } - if (title.endsWith(appName)) { - return title.substring(0, title.length - appName.length).replace(/ - $/, ""); + return title.substring(0, title.length - appName.length).replace(/ (-|—) $/, ""); } return title;