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;