diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index be0f7187..5dda4e74 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -372,6 +372,7 @@ Singleton { property bool showWorkspaceApps: false property bool workspaceDragReorder: true property bool groupWorkspaceApps: true + property bool groupActiveWorkspaceApps: false property int maxWorkspaceIcons: 3 property int workspaceAppIconSizeOffset: 0 property bool workspaceFollowFocus: false diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index fed8de8d..b430630d 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -134,6 +134,7 @@ var SPEC = { maxWorkspaceIcons: { def: 3 }, workspaceAppIconSizeOffset: { def: 0 }, groupWorkspaceApps: { def: true }, + groupActiveWorkspaceApps: { def: false }, workspaceFollowFocus: { def: false }, showOccupiedWorkspacesOnly: { def: false }, reverseScrolling: { def: false }, diff --git a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml index 27a1abf1..eb907184 100644 --- a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml +++ b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml @@ -340,7 +340,8 @@ Item { const keyBase = (w.app_id || w.appId || w.class || w.windowClass || "unknown"); const moddedId = Paths.moddedAppId(keyBase); - const key = isActiveWs || !SettingsData.groupWorkspaceApps ? `${moddedId}_${i}` : moddedId; + const groupThisWs = SettingsData.groupWorkspaceApps && (!isActiveWs || SettingsData.groupActiveWorkspaceApps); + const key = groupThisWs ? moddedId : `${moddedId}_${i}`; if (!byApp[key]) { const isQuickshell = keyBase === "org.quickshell" || keyBase === "com.danklinux.dms"; @@ -1091,7 +1092,7 @@ Item { } } - return (SettingsData.groupWorkspaceApps && !isActive) ? groupedCount : totalCount; + return (SettingsData.groupWorkspaceApps && (!isActive || SettingsData.groupActiveWorkspaceApps)) ? groupedCount : totalCount; } readonly property real baseWidth: root.isVertical ? (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5) : (isActive ? Math.max(root.widgetHeight * 1.05, root.appIconSize * 1.6) : Math.max(root.widgetHeight * 0.7, root.appIconSize * 1.2)) @@ -1883,6 +1884,12 @@ Item { delegateRoot.updateAllData(); } } + Connections { + target: root + function onCurrentWorkspaceChanged() { + delegateRoot.updateAllData(); + } + } Connections { target: NiriService enabled: CompositorService.isNiri @@ -1907,6 +1914,12 @@ Item { function onAppIdSubstitutionsChanged() { delegateRoot.updateAllData(); } + function onGroupWorkspaceAppsChanged() { + delegateRoot.updateAllData(); + } + function onGroupActiveWorkspaceAppsChanged() { + delegateRoot.updateAllData(); + } } Connections { target: DwlService diff --git a/quickshell/Modules/Settings/WorkspacesTab.qml b/quickshell/Modules/Settings/WorkspacesTab.qml index 99955fd6..dca767dc 100644 --- a/quickshell/Modules/Settings/WorkspacesTab.qml +++ b/quickshell/Modules/Settings/WorkspacesTab.qml @@ -125,6 +125,16 @@ Item { onToggled: checked => SettingsData.set("groupWorkspaceApps", checked) } + SettingsToggleRow { + settingKey: "groupActiveWorkspaceApps" + tags: ["workspace", "apps", "icons", "group", "grouped", "active", "focused"] + text: I18n.tr("Group Active Workspace") + description: I18n.tr("Also group repeated application icons on the active workspace") + checked: SettingsData.groupActiveWorkspaceApps + visible: SettingsData.showWorkspaceApps && SettingsData.groupWorkspaceApps + onToggled: checked => SettingsData.set("groupActiveWorkspaceApps", checked) + } + SettingsToggleRow { settingKey: "workspaceActiveAppHighlightEnabled" tags: ["workspace", "apps", "icons", "highlight", "active", "focused"]