mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
workspaces: support ext-workspace-v1
- If available - If not niri, hyprland, sway, or dwl
This commit is contained in:
@@ -23,6 +23,8 @@ Item {
|
||||
return CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
||||
}
|
||||
|
||||
readonly property bool useExtWorkspace: DMSService.forceExtWorkspace || (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isDwl && !CompositorService.isSway && ExtWorkspaceService.extWorkspaceAvailable)
|
||||
|
||||
Connections {
|
||||
target: DesktopEntries
|
||||
function onApplicationsChanged() {
|
||||
@@ -31,7 +33,9 @@ Item {
|
||||
}
|
||||
|
||||
property int currentWorkspace: {
|
||||
if (CompositorService.isNiri) {
|
||||
if (useExtWorkspace) {
|
||||
return getExtWorkspaceActiveWorkspace()
|
||||
} else if (CompositorService.isNiri) {
|
||||
return getNiriActiveWorkspace()
|
||||
} else if (CompositorService.isHyprland) {
|
||||
return getHyprlandActiveWorkspace()
|
||||
@@ -50,13 +54,17 @@ Item {
|
||||
return []
|
||||
}
|
||||
property var workspaceList: {
|
||||
if (useExtWorkspace) {
|
||||
const baseList = getExtWorkspaceWorkspaces()
|
||||
return SettingsData.showWorkspacePadding ? padWorkspaces(baseList) : baseList
|
||||
}
|
||||
if (CompositorService.isNiri) {
|
||||
const baseList = getNiriWorkspaces()
|
||||
return SettingsData.showWorkspacePadding ? padWorkspaces(baseList) : baseList
|
||||
}
|
||||
if (CompositorService.isHyprland) {
|
||||
const baseList = getHyprlandWorkspaces()
|
||||
const filteredList = baseList.filter(ws => ws.id > -1)
|
||||
const filteredList = baseList.filter(ws => ws.id > -1)
|
||||
return SettingsData.showWorkspacePadding ? padWorkspaces(filteredList) : filteredList
|
||||
}
|
||||
if (CompositorService.isDwl) {
|
||||
@@ -192,7 +200,9 @@ Item {
|
||||
function padWorkspaces(list) {
|
||||
const padded = list.slice()
|
||||
let placeholder
|
||||
if (CompositorService.isHyprland) {
|
||||
if (useExtWorkspace) {
|
||||
placeholder = {"id": "", "name": "", "active": false, "hidden": true}
|
||||
} else if (CompositorService.isHyprland) {
|
||||
placeholder = {"id": -1, "name": ""}
|
||||
} else if (CompositorService.isDwl) {
|
||||
placeholder = {"tag": -1}
|
||||
@@ -313,25 +323,77 @@ Item {
|
||||
return activeTags
|
||||
}
|
||||
|
||||
function getExtWorkspaceWorkspaces() {
|
||||
const groups = ExtWorkspaceService.groups
|
||||
if (!ExtWorkspaceService.extWorkspaceAvailable || groups.length === 0) {
|
||||
return [{"id": "1", "name": "1", "active": false}]
|
||||
}
|
||||
|
||||
const group = groups.find(g => g.outputs && g.outputs.includes(root.screenName))
|
||||
if (!group || !group.workspaces) {
|
||||
return [{"id": "1", "name": "1", "active": false}]
|
||||
}
|
||||
|
||||
const visible = group.workspaces.filter(ws => !ws.hidden).sort((a, b) => {
|
||||
const coordsA = a.coordinates || [0, 0]
|
||||
const coordsB = b.coordinates || [0, 0]
|
||||
if (coordsA[0] !== coordsB[0]) return coordsA[0] - coordsB[0]
|
||||
return coordsA[1] - coordsB[1]
|
||||
}).map(ws => ({
|
||||
id: ws.id,
|
||||
name: ws.name,
|
||||
coordinates: ws.coordinates,
|
||||
state: ws.state,
|
||||
active: ws.active,
|
||||
urgent: ws.urgent,
|
||||
hidden: ws.hidden,
|
||||
groupID: group.id
|
||||
}))
|
||||
|
||||
return visible.length > 0 ? visible : [{"id": "1", "name": "1", "active": false}]
|
||||
}
|
||||
|
||||
function getExtWorkspaceActiveWorkspace() {
|
||||
if (!ExtWorkspaceService.extWorkspaceAvailable) {
|
||||
return 1
|
||||
}
|
||||
|
||||
const activeWs = ExtWorkspaceService.getActiveWorkspaceForOutput(root.screenName)
|
||||
return activeWs ? (activeWs.id || activeWs.name || "1") : "1"
|
||||
}
|
||||
|
||||
readonly property real padding: Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||
readonly property real visualWidth: isVertical ? widgetHeight : (workspaceRow.implicitWidth + padding * 2)
|
||||
readonly property real visualHeight: isVertical ? (workspaceRow.implicitHeight + padding * 2) : widgetHeight
|
||||
|
||||
function getRealWorkspaces() {
|
||||
return root.workspaceList.filter(ws => {
|
||||
if (CompositorService.isHyprland) {
|
||||
return ws && ws.id !== -1
|
||||
} else if (CompositorService.isDwl) {
|
||||
return ws && ws.tag !== -1
|
||||
} else if (CompositorService.isSway) {
|
||||
return ws && ws.num !== -1
|
||||
}
|
||||
if (useExtWorkspace) return ws && ws.id !== "" && !ws.hidden
|
||||
if (CompositorService.isHyprland) return ws && ws.id !== -1
|
||||
if (CompositorService.isDwl) return ws && ws.tag !== -1
|
||||
if (CompositorService.isSway) return ws && ws.num !== -1
|
||||
return ws !== -1
|
||||
})
|
||||
}
|
||||
|
||||
function switchWorkspace(direction) {
|
||||
if (CompositorService.isNiri) {
|
||||
if (useExtWorkspace) {
|
||||
const realWorkspaces = getRealWorkspaces()
|
||||
if (realWorkspaces.length < 2) {
|
||||
return
|
||||
}
|
||||
|
||||
const currentIndex = realWorkspaces.findIndex(ws => (ws.id || ws.name) === root.currentWorkspace)
|
||||
const validIndex = currentIndex === -1 ? 0 : currentIndex
|
||||
const nextIndex = direction > 0 ? Math.min(validIndex + 1, realWorkspaces.length - 1) : Math.max(validIndex - 1, 0)
|
||||
|
||||
if (nextIndex === validIndex) {
|
||||
return
|
||||
}
|
||||
|
||||
const nextWorkspace = realWorkspaces[nextIndex]
|
||||
ExtWorkspaceService.activateWorkspace(nextWorkspace.id || nextWorkspace.name, nextWorkspace.groupID || "")
|
||||
} else if (CompositorService.isNiri) {
|
||||
const realWorkspaces = getRealWorkspaces()
|
||||
if (realWorkspaces.length < 2) {
|
||||
return
|
||||
@@ -396,7 +458,7 @@ Item {
|
||||
|
||||
width: isVertical ? barThickness : visualWidth
|
||||
height: isVertical ? visualHeight : barThickness
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || useExtWorkspace
|
||||
|
||||
Rectangle {
|
||||
id: visualBackground
|
||||
@@ -443,23 +505,17 @@ Item {
|
||||
id: delegateRoot
|
||||
|
||||
property bool isActive: {
|
||||
if (CompositorService.isHyprland) {
|
||||
return modelData && modelData.id === root.currentWorkspace
|
||||
} else if (CompositorService.isDwl) {
|
||||
return modelData && root.dwlActiveTags.includes(modelData.tag)
|
||||
} else if (CompositorService.isSway) {
|
||||
return modelData && modelData.num === root.currentWorkspace
|
||||
}
|
||||
if (root.useExtWorkspace) return !!(modelData && modelData.active)
|
||||
if (CompositorService.isHyprland) return !!(modelData && modelData.id === root.currentWorkspace)
|
||||
if (CompositorService.isDwl) return !!(modelData && root.dwlActiveTags.includes(modelData.tag))
|
||||
if (CompositorService.isSway) return !!(modelData && modelData.num === root.currentWorkspace)
|
||||
return modelData === root.currentWorkspace
|
||||
}
|
||||
property bool isPlaceholder: {
|
||||
if (CompositorService.isHyprland) {
|
||||
return modelData && modelData.id === -1
|
||||
} else if (CompositorService.isDwl) {
|
||||
return modelData && modelData.tag === -1
|
||||
} else if (CompositorService.isSway) {
|
||||
return modelData && modelData.num === -1
|
||||
}
|
||||
if (root.useExtWorkspace) return !!(modelData && modelData.hidden)
|
||||
if (CompositorService.isHyprland) return !!(modelData && modelData.id === -1)
|
||||
if (CompositorService.isDwl) return !!(modelData && modelData.tag === -1)
|
||||
if (CompositorService.isSway) return !!(modelData && modelData.num === -1)
|
||||
return modelData === -1
|
||||
}
|
||||
property bool isHovered: mouseArea.containsMouse
|
||||
@@ -467,15 +523,11 @@ Item {
|
||||
property var loadedWorkspaceData: null
|
||||
property bool loadedIsUrgent: false
|
||||
property bool isUrgent: {
|
||||
if (CompositorService.isHyprland) {
|
||||
return modelData?.urgent ?? false
|
||||
} else if (CompositorService.isNiri) {
|
||||
return loadedIsUrgent
|
||||
} else if (CompositorService.isDwl) {
|
||||
return modelData?.state === 2
|
||||
} else if (CompositorService.isSway) {
|
||||
return loadedIsUrgent
|
||||
}
|
||||
if (root.useExtWorkspace) return modelData?.urgent ?? false
|
||||
if (CompositorService.isHyprland) return modelData?.urgent ?? false
|
||||
if (CompositorService.isNiri) return loadedIsUrgent
|
||||
if (CompositorService.isDwl) return modelData?.state === 2
|
||||
if (CompositorService.isSway) return loadedIsUrgent
|
||||
return false
|
||||
}
|
||||
property var loadedIconData: null
|
||||
@@ -511,13 +563,13 @@ Item {
|
||||
enabled: !isPlaceholder
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
onClicked: mouse => {
|
||||
if (isPlaceholder) {
|
||||
return
|
||||
}
|
||||
if (isPlaceholder) return
|
||||
|
||||
const isRightClick = mouse.button === Qt.RightButton
|
||||
|
||||
if (CompositorService.isNiri) {
|
||||
if (root.useExtWorkspace && (modelData?.id || modelData?.name)) {
|
||||
ExtWorkspaceService.activateWorkspace(modelData.id || modelData.name, modelData.groupID || "")
|
||||
} else if (CompositorService.isNiri) {
|
||||
if (isRightClick) {
|
||||
NiriService.toggleOverview()
|
||||
} else {
|
||||
@@ -558,7 +610,9 @@ Item {
|
||||
}
|
||||
|
||||
var wsData = null;
|
||||
if (CompositorService.isNiri) {
|
||||
if (root.useExtWorkspace) {
|
||||
wsData = modelData;
|
||||
} else if (CompositorService.isNiri) {
|
||||
wsData = NiriService.allWorkspaces.find(ws => ws.idx + 1 === modelData && ws.output === root.screenName) || null;
|
||||
} else if (CompositorService.isHyprland) {
|
||||
wsData = modelData;
|
||||
@@ -839,7 +893,9 @@ Item {
|
||||
anchors.centerIn: parent
|
||||
text: {
|
||||
let isPlaceholder
|
||||
if (CompositorService.isHyprland) {
|
||||
if (root.useExtWorkspace) {
|
||||
isPlaceholder = modelData?.hidden === true
|
||||
} else if (CompositorService.isHyprland) {
|
||||
isPlaceholder = modelData?.id === -1
|
||||
} else if (CompositorService.isDwl) {
|
||||
isPlaceholder = modelData?.tag === -1
|
||||
@@ -849,17 +905,12 @@ Item {
|
||||
isPlaceholder = modelData === -1
|
||||
}
|
||||
|
||||
if (isPlaceholder) {
|
||||
return index + 1
|
||||
}
|
||||
if (isPlaceholder) return index + 1
|
||||
|
||||
if (CompositorService.isHyprland) {
|
||||
return modelData?.id || ""
|
||||
} else if (CompositorService.isDwl) {
|
||||
return (modelData?.tag !== undefined) ? (modelData.tag + 1) : ""
|
||||
} else if (CompositorService.isSway) {
|
||||
return modelData?.num || ""
|
||||
}
|
||||
if (root.useExtWorkspace) return modelData?.name || modelData?.id || ""
|
||||
if (CompositorService.isHyprland) return modelData?.id || ""
|
||||
if (CompositorService.isDwl) return (modelData?.tag !== undefined) ? (modelData.tag + 1) : ""
|
||||
if (CompositorService.isSway) return modelData?.num || ""
|
||||
return modelData - 1
|
||||
}
|
||||
color: (isActive || isUrgent) ? Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
|
||||
@@ -898,7 +949,18 @@ Item {
|
||||
enabled: CompositorService.isSway
|
||||
function onValuesChanged() { delegateRoot.updateAllData() }
|
||||
}
|
||||
Connections {
|
||||
target: ExtWorkspaceService
|
||||
enabled: root.useExtWorkspace
|
||||
function onStateChanged() { delegateRoot.updateAllData() }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (useExtWorkspace && !DMSService.activeSubscriptions.includes("extworkspace")) {
|
||||
DMSService.addSubscription("extworkspace")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,8 +81,9 @@ Item {
|
||||
text: I18n.tr("Show Workspace Apps")
|
||||
description: I18n.tr("Display application icons in workspace indicators")
|
||||
checked: SettingsData.showWorkspaceApps
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland
|
||||
onToggled: checked => {
|
||||
return SettingsData.set("showWorkspaceApps",
|
||||
return SettingsData.set("showWorkspaceApps",
|
||||
checked)
|
||||
}
|
||||
}
|
||||
@@ -355,6 +356,7 @@ Item {
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.2)
|
||||
border.width: 0
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland
|
||||
|
||||
Column {
|
||||
id: runningAppsSection
|
||||
|
||||
@@ -20,6 +20,7 @@ Singleton {
|
||||
property bool isConnected: false
|
||||
property bool isConnecting: false
|
||||
property bool subscribeConnected: false
|
||||
readonly property bool forceExtWorkspace: false
|
||||
|
||||
readonly property string socketPath: Quickshell.env("DMS_SOCKET")
|
||||
|
||||
@@ -46,6 +47,7 @@ Singleton {
|
||||
signal dwlStateUpdate(var data)
|
||||
signal brightnessStateUpdate(var data)
|
||||
signal brightnessDeviceUpdate(var device)
|
||||
signal extWorkspaceStateUpdate(var data)
|
||||
|
||||
property var activeSubscriptions: ["network", "network.credentials", "loginctl", "freedesktop", "gamma", "bluetooth", "bluetooth.pairing", "dwl", "brightness"]
|
||||
|
||||
@@ -263,7 +265,7 @@ Singleton {
|
||||
|
||||
function removeSubscription(service) {
|
||||
if (activeSubscriptions.includes("all")) {
|
||||
const allServices = ["network", "loginctl", "freedesktop", "gamma", "bluetooth", "dwl", "brightness"]
|
||||
const allServices = ["network", "loginctl", "freedesktop", "gamma", "bluetooth", "dwl", "brightness", "extworkspace"]
|
||||
const filtered = allServices.filter(s => s !== service)
|
||||
subscribe(filtered)
|
||||
} else {
|
||||
@@ -285,7 +287,7 @@ Singleton {
|
||||
excludeServices = [excludeServices]
|
||||
}
|
||||
|
||||
const allServices = ["network", "loginctl", "freedesktop", "gamma", "bluetooth", "cups", "dwl", "brightness"]
|
||||
const allServices = ["network", "loginctl", "freedesktop", "gamma", "bluetooth", "cups", "dwl", "brightness", "extworkspace"]
|
||||
const filtered = allServices.filter(s => !excludeServices.includes(s))
|
||||
subscribe(filtered)
|
||||
}
|
||||
@@ -342,6 +344,8 @@ Singleton {
|
||||
if (data.device) {
|
||||
brightnessDeviceUpdate(data.device)
|
||||
}
|
||||
} else if (service === "extworkspace") {
|
||||
extWorkspaceStateUpdate(data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
259
Services/ExtWorkspaceService.qml
Normal file
259
Services/ExtWorkspaceService.qml
Normal file
@@ -0,0 +1,259 @@
|
||||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property bool extWorkspaceAvailable: false
|
||||
property var groups: []
|
||||
property var _cachedWorkspaces: ({})
|
||||
|
||||
signal stateChanged()
|
||||
|
||||
Connections {
|
||||
target: DMSService
|
||||
function onCapabilitiesReceived() {
|
||||
checkCapabilities()
|
||||
}
|
||||
function onConnectionStateChanged() {
|
||||
if (DMSService.isConnected) {
|
||||
checkCapabilities()
|
||||
} else {
|
||||
extWorkspaceAvailable = false
|
||||
}
|
||||
}
|
||||
function onExtWorkspaceStateUpdate(data) {
|
||||
if (extWorkspaceAvailable) {
|
||||
handleStateUpdate(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (DMSService.dmsAvailable) {
|
||||
checkCapabilities()
|
||||
}
|
||||
}
|
||||
|
||||
function checkCapabilities() {
|
||||
if (!DMSService.capabilities || !Array.isArray(DMSService.capabilities)) {
|
||||
extWorkspaceAvailable = false
|
||||
return
|
||||
}
|
||||
|
||||
const hasExtWorkspace = DMSService.capabilities.includes("extworkspace")
|
||||
if (hasExtWorkspace && !extWorkspaceAvailable) {
|
||||
extWorkspaceAvailable = true
|
||||
console.info("ExtWorkspaceService: ext-workspace capability detected")
|
||||
requestState()
|
||||
} else if (!hasExtWorkspace) {
|
||||
extWorkspaceAvailable = false
|
||||
}
|
||||
}
|
||||
|
||||
function requestState() {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.getState", null, response => {
|
||||
if (response.result) {
|
||||
handleStateUpdate(response.result)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleStateUpdate(state) {
|
||||
groups = state.groups || []
|
||||
if (groups.length === 0) {
|
||||
console.warn("ExtWorkspaceService: Received empty workspace groups from backend")
|
||||
} else {
|
||||
console.log("ExtWorkspaceService: Updated with", groups.length, "workspace groups")
|
||||
}
|
||||
stateChanged()
|
||||
}
|
||||
|
||||
function activateWorkspace(workspaceID, groupID = "") {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.activateWorkspace", {
|
||||
"workspaceID": workspaceID,
|
||||
"groupID": groupID
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: activateWorkspace error:", response.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function deactivateWorkspace(workspaceID, groupID = "") {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.deactivateWorkspace", {
|
||||
"workspaceID": workspaceID,
|
||||
"groupID": groupID
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: deactivateWorkspace error:", response.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function removeWorkspace(workspaceID, groupID = "") {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.removeWorkspace", {
|
||||
"workspaceID": workspaceID,
|
||||
"groupID": groupID
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: removeWorkspace error:", response.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function createWorkspace(groupID, name) {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.createWorkspace", {
|
||||
"groupID": groupID,
|
||||
"name": name
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: createWorkspace error:", response.error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getGroupForOutput(outputName) {
|
||||
for (const group of groups) {
|
||||
if (group.outputs && group.outputs.includes(outputName)) {
|
||||
return group
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
function getWorkspacesForOutput(outputName) {
|
||||
const group = getGroupForOutput(outputName)
|
||||
return group ? (group.workspaces || []) : []
|
||||
}
|
||||
|
||||
function getActiveWorkspaces() {
|
||||
const active = []
|
||||
for (const group of groups) {
|
||||
if (!group.workspaces) continue
|
||||
for (const ws of group.workspaces) {
|
||||
if (ws.active) {
|
||||
active.push({
|
||||
workspace: ws,
|
||||
group: group,
|
||||
outputs: group.outputs || []
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return active
|
||||
}
|
||||
|
||||
function getActiveWorkspaceForOutput(outputName) {
|
||||
const group = getGroupForOutput(outputName)
|
||||
if (!group || !group.workspaces) return null
|
||||
|
||||
for (const ws of group.workspaces) {
|
||||
if (ws.active) {
|
||||
return ws
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
function getVisibleWorkspaces(outputName) {
|
||||
const workspaces = getWorkspacesForOutput(outputName)
|
||||
const visible = workspaces.filter(ws => !ws.hidden).sort((a, b) => {
|
||||
const coordsA = a.coordinates || [0, 0]
|
||||
const coordsB = b.coordinates || [0, 0]
|
||||
if (coordsA[0] !== coordsB[0]) return coordsA[0] - coordsB[0]
|
||||
return coordsA[1] - coordsB[1]
|
||||
})
|
||||
|
||||
const cacheKey = outputName
|
||||
if (!_cachedWorkspaces[cacheKey]) {
|
||||
_cachedWorkspaces[cacheKey] = {
|
||||
workspaces: [],
|
||||
lastNames: []
|
||||
}
|
||||
}
|
||||
|
||||
const cache = _cachedWorkspaces[cacheKey]
|
||||
const currentNames = visible.map(ws => ws.name || ws.id)
|
||||
const namesChanged = JSON.stringify(cache.lastNames) !== JSON.stringify(currentNames)
|
||||
|
||||
if (namesChanged || cache.workspaces.length !== visible.length) {
|
||||
cache.workspaces = visible.map(ws => ({
|
||||
id: ws.id,
|
||||
name: ws.name,
|
||||
coordinates: ws.coordinates,
|
||||
state: ws.state,
|
||||
active: ws.active,
|
||||
urgent: ws.urgent,
|
||||
hidden: ws.hidden
|
||||
}))
|
||||
cache.lastNames = currentNames
|
||||
return cache.workspaces
|
||||
}
|
||||
|
||||
for (let i = 0; i < visible.length; i++) {
|
||||
const src = visible[i]
|
||||
const dst = cache.workspaces[i]
|
||||
dst.id = src.id
|
||||
dst.name = src.name
|
||||
dst.coordinates = src.coordinates
|
||||
dst.state = src.state
|
||||
dst.active = src.active
|
||||
dst.urgent = src.urgent
|
||||
dst.hidden = src.hidden
|
||||
}
|
||||
|
||||
return cache.workspaces
|
||||
}
|
||||
|
||||
function getUrgentWorkspaces() {
|
||||
const urgent = []
|
||||
for (const group of groups) {
|
||||
if (!group.workspaces) continue
|
||||
for (const ws of group.workspaces) {
|
||||
if (ws.urgent) {
|
||||
urgent.push({
|
||||
workspace: ws,
|
||||
group: group,
|
||||
outputs: group.outputs || []
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
return urgent
|
||||
}
|
||||
|
||||
function switchToWorkspace(outputName, workspaceName) {
|
||||
const workspaces = getWorkspacesForOutput(outputName)
|
||||
for (const ws of workspaces) {
|
||||
if (ws.name === workspaceName || ws.id === workspaceName) {
|
||||
activateWorkspace(ws.name || ws.id)
|
||||
return
|
||||
}
|
||||
}
|
||||
console.warn("ExtWorkspaceService: workspace not found:", workspaceName)
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
{
|
||||
"term": "(Unnamed)",
|
||||
"context": "(Unnamed)",
|
||||
"reference": "Modules/Dock/DockContextMenu.qml:227",
|
||||
"reference": "Modules/Dock/DockContextMenu.qml:229",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -140,7 +140,7 @@
|
||||
{
|
||||
"term": "Always Show OSD Percentage",
|
||||
"context": "Always Show OSD Percentage",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:675",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:677",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -428,7 +428,7 @@
|
||||
{
|
||||
"term": "Back",
|
||||
"context": "Back",
|
||||
"reference": "Modules/DankBar/Widgets/SystemTrayBar.qml:511",
|
||||
"reference": "Modules/DankBar/Widgets/SystemTrayBar.qml:514",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -644,7 +644,7 @@
|
||||
{
|
||||
"term": "Choose where notification popups appear on screen",
|
||||
"context": "Choose where notification popups appear on screen",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:602",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:604",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -788,7 +788,7 @@
|
||||
{
|
||||
"term": "Configure icons for named workspaces. Icons take priority over numbers when both are enabled.",
|
||||
"context": "Configure icons for named workspaces. Icons take priority over numbers when both are enabled.",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:438",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:440",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -890,7 +890,7 @@
|
||||
{
|
||||
"term": "Copied!",
|
||||
"context": "Copied!",
|
||||
"reference": "Modules/Toast.qml:17",
|
||||
"reference": "Modules/Toast.qml:19",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1010,7 +1010,7 @@
|
||||
{
|
||||
"term": "DMS out of date",
|
||||
"context": "DMS out of date",
|
||||
"reference": "Services/DMSService.qml:298",
|
||||
"reference": "Services/DMSService.qml:300",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1208,7 +1208,7 @@
|
||||
{
|
||||
"term": "Display volume and brightness percentage values by default in OSD popups",
|
||||
"context": "Display volume and brightness percentage values by default in OSD popups",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:682",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:684",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -1988,7 +1988,7 @@
|
||||
{
|
||||
"term": "Launch on dGPU",
|
||||
"context": "Launch on dGPU",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:312, Modules/AppDrawer/AppDrawerPopout.qml:806, Modules/Dock/DockContextMenu.qml:418",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:312, Modules/AppDrawer/AppDrawerPopout.qml:806, Modules/Dock/DockContextMenu.qml:420",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2168,7 +2168,7 @@
|
||||
{
|
||||
"term": "Max apps to show",
|
||||
"context": "Max apps to show",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:103",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:104",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2210,7 +2210,7 @@
|
||||
{
|
||||
"term": "Media Player Settings",
|
||||
"context": "Media Player Settings",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:183",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:184",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2306,7 +2306,7 @@
|
||||
{
|
||||
"term": "Named Workspace Icons",
|
||||
"context": "Named Workspace Icons",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:428",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:430",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2516,7 +2516,7 @@
|
||||
{
|
||||
"term": "Notification Popups",
|
||||
"context": "Notification Popups",
|
||||
"reference": "Modules/Settings/DisplaysTab.qml:24, Modules/Settings/WidgetTweaksTab.qml:585",
|
||||
"reference": "Modules/Settings/DisplaysTab.qml:24, Modules/Settings/WidgetTweaksTab.qml:587",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2702,7 +2702,7 @@
|
||||
{
|
||||
"term": "Per-Monitor Workspaces",
|
||||
"context": "Per-Monitor Workspaces",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:134",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:135",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2726,7 +2726,7 @@
|
||||
{
|
||||
"term": "Pin to Dock",
|
||||
"context": "Pin to Dock",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:110, Modals/Spotlight/SpotlightContextMenu.qml:113, Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:371",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:110, Modals/Spotlight/SpotlightContextMenu.qml:113, Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:373",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2804,7 +2804,7 @@
|
||||
{
|
||||
"term": "Popup Position",
|
||||
"context": "Popup Position",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:601",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:603",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3074,13 +3074,13 @@
|
||||
{
|
||||
"term": "Running Apps Only In Current Workspace",
|
||||
"context": "Running Apps Only In Current Workspace",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:388",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:390",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "Running Apps Settings",
|
||||
"context": "Running Apps Settings",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:378",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:380",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3272,7 +3272,7 @@
|
||||
{
|
||||
"term": "Show All Tags",
|
||||
"context": "Show All Tags",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:144",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:145",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3308,7 +3308,7 @@
|
||||
{
|
||||
"term": "Show all 9 tags instead of only occupied tags (DWL only)",
|
||||
"context": "Show all 9 tags instead of only occupied tags (DWL only)",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:145",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:146",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3344,13 +3344,13 @@
|
||||
{
|
||||
"term": "Show only apps running in current workspace",
|
||||
"context": "Show only apps running in current workspace",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:389",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:391",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "Show only workspaces belonging to each specific monitor.",
|
||||
"context": "Show only workspaces belonging to each specific monitor.",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:135",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:136",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3596,7 +3596,7 @@
|
||||
{
|
||||
"term": "System Updater",
|
||||
"context": "System Updater",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:230",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:231",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3632,7 +3632,7 @@
|
||||
{
|
||||
"term": "System update custom command",
|
||||
"context": "System update custom command",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:266",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:267",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3644,7 +3644,7 @@
|
||||
{
|
||||
"term": "Terminal custom additional parameters",
|
||||
"context": "Terminal custom additional parameters",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:313",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:314",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3728,7 +3728,7 @@
|
||||
{
|
||||
"term": "To update, run the following command:",
|
||||
"context": "To update, run the following command:",
|
||||
"reference": "Services/DMSService.qml:298",
|
||||
"reference": "Services/DMSService.qml:300",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3806,7 +3806,7 @@
|
||||
{
|
||||
"term": "Unpin from Dock",
|
||||
"context": "Unpin from Dock",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:113, Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:371",
|
||||
"reference": "Modals/Spotlight/SpotlightContextMenu.qml:113, Modules/AppDrawer/AppDrawerPopout.qml:609, Modules/Dock/DockContextMenu.qml:373",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3854,7 +3854,7 @@
|
||||
{
|
||||
"term": "Use Custom Command",
|
||||
"context": "Use Custom Command",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:240",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:241",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3890,13 +3890,13 @@
|
||||
{
|
||||
"term": "Use animated wave progress bars for media playback",
|
||||
"context": "Use animated wave progress bars for media playback",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:194",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:195",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
"term": "Use custom command for update your system",
|
||||
"context": "Use custom command for update your system",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:241",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:242",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -4034,7 +4034,7 @@
|
||||
{
|
||||
"term": "Wave Progress Bars",
|
||||
"context": "Wave Progress Bars",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:193",
|
||||
"reference": "Modules/Settings/WidgetTweaksTab.qml:194",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user