mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-08 06:25:37 -05:00
dwl: hide empty tags by default
This commit is contained in:
@@ -576,10 +576,13 @@ Item {
|
||||
|
||||
return monitorWorkspaces.sort((a, b) => a.id - b.id)
|
||||
} else if (CompositorService.isDwl) {
|
||||
if (!DwlService.dwlAvailable || DwlService.tagCount === 0) {
|
||||
return Array.from({length: 9}, (_, i) => i)
|
||||
if (!DwlService.dwlAvailable) {
|
||||
return [0]
|
||||
}
|
||||
return Array.from({length: DwlService.tagCount}, (_, i) => i)
|
||||
if (SettingsData.dwlShowAllTags) {
|
||||
return Array.from({length: DwlService.tagCount}, (_, i) => i)
|
||||
}
|
||||
return DwlService.getVisibleTags(barWindow.screenName)
|
||||
} else if (CompositorService.isSway) {
|
||||
const workspaces = I3.workspaces?.values || []
|
||||
if (workspaces.length === 0) return [{"num": 1}]
|
||||
|
||||
@@ -278,15 +278,23 @@ Item {
|
||||
|
||||
const output = DwlService.getOutputState(root.screenName)
|
||||
if (!output || !output.tags || output.tags.length === 0) {
|
||||
const tagCount = DwlService.tagCount || 9
|
||||
const tags = []
|
||||
for (let i = 0; i < tagCount; i++) {
|
||||
tags.push({"tag": i})
|
||||
}
|
||||
return tags
|
||||
return [{"tag": 0}]
|
||||
}
|
||||
|
||||
return output.tags.map(tag => ({"tag": tag.tag, "state": tag.state, "clients": tag.clients, "focused": tag.focused}))
|
||||
if (SettingsData.dwlShowAllTags) {
|
||||
return output.tags.map(tag => ({"tag": tag.tag, "state": tag.state, "clients": tag.clients, "focused": tag.focused}))
|
||||
}
|
||||
|
||||
const visibleTagIndices = DwlService.getVisibleTags(root.screenName)
|
||||
return visibleTagIndices.map(tagIndex => {
|
||||
const tagData = output.tags.find(t => t.tag === tagIndex)
|
||||
return {
|
||||
"tag": tagIndex,
|
||||
"state": tagData?.state ?? 0,
|
||||
"clients": tagData?.clients ?? 0,
|
||||
"focused": tagData?.focused ?? false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function getDwlActiveTag() {
|
||||
|
||||
Reference in New Issue
Block a user