mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-11 00:02:28 -04:00
miraclewm: add support for Miracle WM
This commit is contained in:
@@ -197,7 +197,7 @@ Item {
|
||||
if (CompositorService.isNiri && NiriService.currentOutput) {
|
||||
return NiriService.currentOutput;
|
||||
}
|
||||
if ((CompositorService.isSway || CompositorService.isScroll) && I3.workspaces?.values) {
|
||||
if ((CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) && I3.workspaces?.values) {
|
||||
const focusedWs = I3.workspaces.values.find(ws => ws.focused === true);
|
||||
return focusedWs?.monitor?.name || "";
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ Item {
|
||||
focusedScreenName = Hyprland.focusedWorkspace.monitor.name;
|
||||
} else if (CompositorService.isNiri && NiriService.currentOutput) {
|
||||
focusedScreenName = NiriService.currentOutput;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
focusedScreenName = focusedWs?.monitor?.name || "";
|
||||
} else if (CompositorService.isDwl && DwlService.activeOutput) {
|
||||
@@ -125,7 +125,7 @@ Item {
|
||||
focusedScreenName = Hyprland.focusedWorkspace.monitor.name;
|
||||
} else if (CompositorService.isNiri && NiriService.currentOutput) {
|
||||
focusedScreenName = NiriService.currentOutput;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
focusedScreenName = focusedWs?.monitor?.name || "";
|
||||
} else if (CompositorService.isDwl && DwlService.activeOutput) {
|
||||
|
||||
@@ -103,7 +103,7 @@ Item {
|
||||
}, (_, i) => i);
|
||||
}
|
||||
return DwlService.getVisibleTags(barWindow.screenName);
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const workspaces = I3.workspaces?.values || [];
|
||||
if (workspaces.length === 0)
|
||||
return [
|
||||
@@ -145,7 +145,7 @@ Item {
|
||||
return 0;
|
||||
const activeTags = DwlService.getActiveTags(barWindow.screenName);
|
||||
return activeTags.length > 0 ? activeTags[0] : 0;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
if (!barWindow.screenName || SettingsData.workspaceFollowFocus) {
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
return focusedWs ? focusedWs.num : 1;
|
||||
@@ -194,7 +194,7 @@ Item {
|
||||
if (nextIndex !== validIndex) {
|
||||
DwlService.switchToTag(barWindow.screenName, realWorkspaces[nextIndex]);
|
||||
}
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const currentWs = getCurrentWorkspace();
|
||||
const currentIndex = realWorkspaces.findIndex(ws => ws.num === currentWs);
|
||||
const validIndex = currentIndex === -1 ? 0 : currentIndex;
|
||||
|
||||
@@ -55,7 +55,7 @@ BasePill {
|
||||
}
|
||||
|
||||
IconImage {
|
||||
visible: SettingsData.launcherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isLabwc)
|
||||
visible: SettingsData.launcherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
|
||||
anchors.centerIn: parent
|
||||
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.noBackground)
|
||||
@@ -72,6 +72,8 @@ BasePill {
|
||||
return "file://" + Theme.shellDir + "/assets/sway.svg";
|
||||
} else if (CompositorService.isScroll) {
|
||||
return "file://" + Theme.shellDir + "/assets/sway.svg";
|
||||
} else if (CompositorService.isMiracle) {
|
||||
return "file://" + Theme.shellDir + "/assets/miraclewm.svg";
|
||||
} else if (CompositorService.isLabwc) {
|
||||
return "file://" + Theme.shellDir + "/assets/labwc.png";
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ Item {
|
||||
return DwlService.activeOutput || root.screenName;
|
||||
case "sway":
|
||||
case "scroll":
|
||||
case "miracle":
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
return focusedWs?.monitor?.name || root.screenName;
|
||||
default:
|
||||
@@ -44,7 +45,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property bool useExtWorkspace: DMSService.forceExtWorkspace || (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isDwl && !CompositorService.isSway && !CompositorService.isScroll && ExtWorkspaceService.extWorkspaceAvailable)
|
||||
readonly property bool useExtWorkspace: DMSService.forceExtWorkspace || (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isDwl && !CompositorService.isSway && !CompositorService.isScroll && !CompositorService.isMiracle && ExtWorkspaceService.extWorkspaceAvailable)
|
||||
|
||||
Connections {
|
||||
target: DesktopEntries
|
||||
@@ -67,6 +68,7 @@ Item {
|
||||
return activeTags.length > 0 ? activeTags[0] : -1;
|
||||
case "sway":
|
||||
case "scroll":
|
||||
case "miracle":
|
||||
return getSwayActiveWorkspace();
|
||||
default:
|
||||
return 1;
|
||||
@@ -97,6 +99,7 @@ Item {
|
||||
break;
|
||||
case "sway":
|
||||
case "scroll":
|
||||
case "miracle":
|
||||
baseList = getSwayWorkspaces();
|
||||
break;
|
||||
default:
|
||||
@@ -114,12 +117,23 @@ Item {
|
||||
}
|
||||
];
|
||||
|
||||
function mapWorkspace(ws) {
|
||||
return {
|
||||
"num": ws.number,
|
||||
"name": ws.name,
|
||||
"focused": ws.focused,
|
||||
"active": ws.active,
|
||||
"urgent": ws.urgent,
|
||||
"monitor": ws.monitor
|
||||
};
|
||||
}
|
||||
|
||||
if (!root.screenName || SettingsData.workspaceFollowFocus) {
|
||||
return workspaces.slice().sort((a, b) => a.num - b.num);
|
||||
return workspaces.slice().sort((a, b) => a.num - b.num).map(mapWorkspace);
|
||||
}
|
||||
|
||||
const monitorWorkspaces = workspaces.filter(ws => ws.monitor?.name === root.screenName);
|
||||
return monitorWorkspaces.length > 0 ? monitorWorkspaces.sort((a, b) => a.num - b.num) : [
|
||||
return monitorWorkspaces.length > 0 ? monitorWorkspaces.sort((a, b) => a.num - b.num).map(mapWorkspace) : [
|
||||
{
|
||||
"num": 1
|
||||
}
|
||||
@@ -222,7 +236,7 @@ Item {
|
||||
return [];
|
||||
}
|
||||
targetWorkspaceId = ws.tag;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
targetWorkspaceId = ws.num !== undefined ? ws.num : ws;
|
||||
} else {
|
||||
return [];
|
||||
@@ -234,7 +248,7 @@ Item {
|
||||
let isActiveWs = false;
|
||||
if (CompositorService.isNiri) {
|
||||
isActiveWs = NiriService.allWorkspaces.some(ws => ws.id === targetWorkspaceId && ws.is_active);
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
isActiveWs = focusedWs ? (focusedWs.num === targetWorkspaceId) : false;
|
||||
} else if (CompositorService.isDwl) {
|
||||
@@ -255,7 +269,7 @@ Item {
|
||||
let winWs = null;
|
||||
if (CompositorService.isNiri) {
|
||||
winWs = w.workspace_id;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
winWs = w.workspace?.num;
|
||||
} else {
|
||||
const hyprlandToplevels = Array.from(Hyprland.toplevels?.values || []);
|
||||
@@ -322,7 +336,7 @@ Item {
|
||||
placeholder = {
|
||||
"tag": -1
|
||||
};
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
placeholder = {
|
||||
"num": -1
|
||||
};
|
||||
@@ -516,7 +530,7 @@ Item {
|
||||
return ws && ws.id !== -1;
|
||||
if (CompositorService.isDwl)
|
||||
return ws && ws.tag !== -1;
|
||||
if (CompositorService.isSway || CompositorService.isScroll)
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
return ws && ws.num !== -1;
|
||||
return ws !== -1;
|
||||
});
|
||||
@@ -588,7 +602,7 @@ Item {
|
||||
}
|
||||
|
||||
DwlService.switchToTag(root.screenName, realWorkspaces[nextIndex].tag);
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const realWorkspaces = getRealWorkspaces();
|
||||
if (realWorkspaces.length < 2) {
|
||||
return;
|
||||
@@ -617,7 +631,7 @@ Item {
|
||||
return modelData?.id || "";
|
||||
if (CompositorService.isDwl)
|
||||
return (modelData?.tag !== undefined) ? (modelData.tag + 1) : "";
|
||||
if (CompositorService.isSway || CompositorService.isScroll)
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
return modelData?.num || "";
|
||||
return modelData - 1;
|
||||
}
|
||||
@@ -632,7 +646,7 @@ Item {
|
||||
isPlaceholder = modelData?.id === -1;
|
||||
} else if (CompositorService.isDwl) {
|
||||
isPlaceholder = modelData?.tag === -1;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
isPlaceholder = modelData?.num === -1;
|
||||
} else {
|
||||
isPlaceholder = modelData === -1;
|
||||
@@ -665,7 +679,7 @@ Item {
|
||||
return getWorkspaceIndexFallback(modelData, index);
|
||||
}
|
||||
|
||||
readonly property bool hasNativeWorkspaceSupport: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll
|
||||
readonly property bool hasNativeWorkspaceSupport: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
||||
readonly property bool hasWorkspaces: getRealWorkspaces().length > 0
|
||||
readonly property bool shouldShow: hasNativeWorkspaceSupport || (useExtWorkspace && hasWorkspaces)
|
||||
|
||||
@@ -865,7 +879,7 @@ Item {
|
||||
return !!(modelData && modelData.id === root.currentWorkspace);
|
||||
if (CompositorService.isDwl)
|
||||
return !!(modelData && root.dwlActiveTags.includes(modelData.tag));
|
||||
if (CompositorService.isSway || CompositorService.isScroll)
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
return !!(modelData && modelData.num === root.currentWorkspace);
|
||||
return modelData === root.currentWorkspace;
|
||||
}
|
||||
@@ -889,7 +903,7 @@ Item {
|
||||
return !!(modelData && modelData.id === -1);
|
||||
if (CompositorService.isDwl)
|
||||
return !!(modelData && modelData.tag === -1);
|
||||
if (CompositorService.isSway || CompositorService.isScroll)
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
return !!(modelData && modelData.num === -1);
|
||||
return modelData === -1;
|
||||
}
|
||||
@@ -906,7 +920,7 @@ Item {
|
||||
return loadedIsUrgent;
|
||||
if (CompositorService.isDwl)
|
||||
return modelData?.state === 2;
|
||||
if (CompositorService.isSway || CompositorService.isScroll)
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
return loadedIsUrgent;
|
||||
return false;
|
||||
}
|
||||
@@ -927,7 +941,7 @@ Item {
|
||||
targetWorkspaceId = modelData?.id;
|
||||
} else if (CompositorService.isDwl) {
|
||||
targetWorkspaceId = modelData?.tag;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
targetWorkspaceId = modelData?.num;
|
||||
}
|
||||
if (targetWorkspaceId === undefined || targetWorkspaceId === null)
|
||||
@@ -946,7 +960,7 @@ Item {
|
||||
let winWs = null;
|
||||
if (CompositorService.isNiri) {
|
||||
winWs = w.workspace_id;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
winWs = w.workspace?.num;
|
||||
} else if (CompositorService.isHyprland) {
|
||||
const hyprlandToplevels = Array.from(Hyprland.toplevels?.values || []);
|
||||
@@ -971,7 +985,7 @@ Item {
|
||||
readonly property real baseWidth: root.isVertical ? (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5) : (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7)
|
||||
readonly property real baseHeight: root.isVertical ? (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7) : (SettingsData.showWorkspaceApps ? Math.max(widgetHeight * 0.7, root.appIconSize + Theme.spacingXS * 2) : widgetHeight * 0.5)
|
||||
readonly property bool hasWorkspaceName: SettingsData.showWorkspaceName && modelData?.name && modelData.name !== ""
|
||||
readonly property bool workspaceNamesEnabled: SettingsData.showWorkspaceName && CompositorService.isNiri
|
||||
readonly property bool workspaceNamesEnabled: SettingsData.showWorkspaceName && (CompositorService.isNiri || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
readonly property real contentImplicitWidth: (hasWorkspaceName || loadedHasIcon) ? (appIconsLoader.item?.contentWidth ?? 0) : 0
|
||||
readonly property real contentImplicitHeight: (workspaceNamesEnabled || loadedHasIcon) ? (appIconsLoader.item?.contentHeight ?? 0) : 0
|
||||
|
||||
@@ -1123,9 +1137,7 @@ Item {
|
||||
return;
|
||||
|
||||
if (!dragHandler.dragging) {
|
||||
const distance = root.isVertical
|
||||
? Math.abs(mouse.y - dragHandler.dragStartPos.y)
|
||||
: Math.abs(mouse.x - dragHandler.dragStartPos.x);
|
||||
const distance = root.isVertical ? Math.abs(mouse.y - dragHandler.dragStartPos.y) : Math.abs(mouse.x - dragHandler.dragStartPos.x);
|
||||
if (distance > 5) {
|
||||
dragHandler.dragging = true;
|
||||
root.dragSourceIndex = index;
|
||||
@@ -1136,9 +1148,7 @@ Item {
|
||||
if (!dragHandler.dragging)
|
||||
return;
|
||||
|
||||
const rawAxisOffset = root.isVertical
|
||||
? (mouse.y - dragHandler.dragStartPos.y)
|
||||
: (mouse.x - dragHandler.dragStartPos.x);
|
||||
const rawAxisOffset = root.isVertical ? (mouse.y - dragHandler.dragStartPos.y) : (mouse.x - dragHandler.dragStartPos.x);
|
||||
|
||||
const itemSize = (root.isVertical ? delegateRoot.height : delegateRoot.width) + Theme.spacingS;
|
||||
const maxOffsetPositive = (root.workspaceList.length - 1 - index) * itemSize;
|
||||
@@ -1189,7 +1199,7 @@ Item {
|
||||
Hyprland.dispatch(`workspace ${modelData.id}`);
|
||||
} else if (CompositorService.isDwl && modelData?.tag !== undefined) {
|
||||
DwlService.switchToTag(root.screenName, modelData.tag);
|
||||
} else if ((CompositorService.isSway || CompositorService.isScroll) && modelData?.num) {
|
||||
} else if ((CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) && modelData?.num) {
|
||||
try {
|
||||
I3.dispatch(`workspace number ${modelData.num}`);
|
||||
} catch (_) {}
|
||||
@@ -1228,7 +1238,7 @@ Item {
|
||||
wsData = modelData;
|
||||
} else if (CompositorService.isDwl) {
|
||||
wsData = modelData;
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
wsData = modelData;
|
||||
}
|
||||
delegateRoot.loadedWorkspaceData = wsData;
|
||||
@@ -1247,7 +1257,7 @@ Item {
|
||||
delegateRoot.loadedHasIcon = icData !== null;
|
||||
|
||||
if (SettingsData.showWorkspaceApps) {
|
||||
if (CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll) {
|
||||
if (CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
delegateRoot.loadedIcons = root.getWorkspaceIcons(modelData);
|
||||
} else if (CompositorService.isNiri) {
|
||||
delegateRoot.loadedIcons = root.getWorkspaceIcons(isPlaceholder ? null : modelData);
|
||||
@@ -1760,7 +1770,7 @@ Item {
|
||||
}
|
||||
Connections {
|
||||
target: I3.workspaces
|
||||
enabled: (CompositorService.isSway || CompositorService.isScroll)
|
||||
enabled: (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
|
||||
function onValuesChanged() {
|
||||
delegateRoot.updateAllData();
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ Card {
|
||||
return "on Sway";
|
||||
if (CompositorService.isScroll)
|
||||
return "on Scroll";
|
||||
if (CompositorService.isMiracle)
|
||||
return "on Miracle WM";
|
||||
return "";
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
|
||||
@@ -236,7 +236,7 @@ Item {
|
||||
}
|
||||
|
||||
IconImage {
|
||||
visible: SettingsData.dockLauncherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isLabwc)
|
||||
visible: SettingsData.dockLauncherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
|
||||
anchors.centerIn: parent
|
||||
width: actualIconSize + SettingsData.dockLauncherLogoSizeOffset
|
||||
height: actualIconSize + SettingsData.dockLauncherLogoSizeOffset
|
||||
@@ -253,6 +253,8 @@ Item {
|
||||
return "file://" + Theme.shellDir + "/assets/sway.svg";
|
||||
} else if (CompositorService.isScroll) {
|
||||
return "file://" + Theme.shellDir + "/assets/sway.svg";
|
||||
} else if (CompositorService.isMiracle) {
|
||||
return "file://" + Theme.shellDir + "/assets/miraclewm.svg";
|
||||
} else if (CompositorService.isLabwc) {
|
||||
return "file://" + Theme.shellDir + "/assets/labwc.png";
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ dms-greeter - DankMaterialShell greeter launcher
|
||||
Usage: dms-greeter --command COMPOSITOR [OPTIONS]
|
||||
|
||||
Required:
|
||||
--command COMPOSITOR Compositor to use (niri, hyprland, sway, scroll, mango, or labwc)
|
||||
--command COMPOSITOR Compositor to use (niri, hyprland, sway, scroll, miracle, mango, or labwc)
|
||||
|
||||
Options:
|
||||
-C, --config PATH Custom compositor config file
|
||||
@@ -244,6 +244,24 @@ SCROLL_EOF
|
||||
exec scroll -c "$COMPOSITOR_CONFIG"
|
||||
;;
|
||||
|
||||
miracle|miracle-wm)
|
||||
if [[ -z "$COMPOSITOR_CONFIG" ]]; then
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat > "$TEMP_CONFIG" << MIRACLE_EOF
|
||||
exec "$QS_CMD; miraclemsg exit"
|
||||
MIRACLE_EOF
|
||||
COMPOSITOR_CONFIG="$TEMP_CONFIG"
|
||||
else
|
||||
TEMP_CONFIG=$(mktemp)
|
||||
cat "$COMPOSITOR_CONFIG" > "$TEMP_CONFIG"
|
||||
cat >> "$TEMP_CONFIG" << MIRACLE_EOF
|
||||
|
||||
exec "$QS_CMD; miraclemsg exit"
|
||||
MIRACLE_EOF
|
||||
COMPOSITOR_CONFIG="$TEMP_CONFIG"
|
||||
fi
|
||||
exec miracle-wm -c "$COMPOSITOR_CONFIG"
|
||||
;;
|
||||
|
||||
labwc)
|
||||
if [[ -n "$COMPOSITOR_CONFIG" ]]; then
|
||||
@@ -263,7 +281,7 @@ SCROLL_EOF
|
||||
|
||||
*)
|
||||
echo "Error: Unsupported compositor: $COMPOSITOR" >&2
|
||||
echo "Supported compositors: niri, hyprland, sway, scroll, mango, labwc" >&2
|
||||
echo "Supported compositors: niri, hyprland, sway, scroll, miracle, mango, labwc" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -14,6 +14,7 @@ Item {
|
||||
property bool isNiri: CompositorService.isNiri
|
||||
property bool isSway: CompositorService.isSway
|
||||
property bool isScroll: CompositorService.isScroll
|
||||
property bool isMiracle: CompositorService.isMiracle
|
||||
property bool isDwl: CompositorService.isDwl
|
||||
property bool isLabwc: CompositorService.isLabwc
|
||||
|
||||
@@ -24,6 +25,8 @@ Item {
|
||||
return "sway";
|
||||
if (isScroll)
|
||||
return "scroll";
|
||||
if (isMiracle)
|
||||
return "miracle";
|
||||
if (isDwl)
|
||||
return "mangowc";
|
||||
if (isLabwc)
|
||||
@@ -38,6 +41,8 @@ Item {
|
||||
return "/assets/sway.svg";
|
||||
if (isScroll)
|
||||
return "/assets/sway.svg";
|
||||
if (isMiracle)
|
||||
return "/assets/miraclewm.svg";
|
||||
if (isDwl)
|
||||
return "/assets/mango.png";
|
||||
if (isLabwc)
|
||||
@@ -52,6 +57,8 @@ Item {
|
||||
return "https://swaywm.org";
|
||||
if (isScroll)
|
||||
return "https://github.com/dawsers/scroll";
|
||||
if (isMiracle)
|
||||
return "https://github.com/miracle-wm-org/miracle-wm";
|
||||
if (isDwl)
|
||||
return "https://github.com/DreamMaoMao/mangowc";
|
||||
if (isLabwc)
|
||||
@@ -66,6 +73,8 @@ Item {
|
||||
return "Sway Website";
|
||||
if (isScroll)
|
||||
return "Scroll Github";
|
||||
if (isMiracle)
|
||||
return "Miracle WM GitHub";
|
||||
if (isDwl)
|
||||
return "mangowc GitHub";
|
||||
if (isLabwc)
|
||||
@@ -98,9 +107,9 @@ Item {
|
||||
property string ircUrl: "https://web.libera.chat/gamja/?channels=#labwc"
|
||||
property string ircTooltip: "LabWC IRC Channel"
|
||||
|
||||
property bool showMatrix: isNiri && !isHyprland && !isSway && !isScroll && !isDwl && !isLabwc
|
||||
property bool showMatrix: isNiri && !isHyprland && !isSway && !isScroll && !isMiracle && !isDwl && !isLabwc
|
||||
property bool showCompositorDiscord: isHyprland || isDwl
|
||||
property bool showReddit: isNiri && !isHyprland && !isSway && !isScroll && !isDwl && !isLabwc
|
||||
property bool showReddit: isNiri && !isHyprland && !isSway && !isScroll && !isMiracle && !isDwl && !isLabwc
|
||||
property bool showIrc: isLabwc
|
||||
|
||||
DankFlickable {
|
||||
|
||||
@@ -264,6 +264,8 @@ Item {
|
||||
modes.push("Sway");
|
||||
} else if (CompositorService.isScroll) {
|
||||
modes.push("Scroll");
|
||||
} else if (CompositorService.isMiracle) {
|
||||
modes.push("Miracle");
|
||||
} else {
|
||||
modes.push(I18n.tr("Compositor"));
|
||||
}
|
||||
|
||||
@@ -67,6 +67,8 @@ Item {
|
||||
modes.push("Sway");
|
||||
} else if (CompositorService.isScroll) {
|
||||
modes.push("Scroll");
|
||||
} else if (CompositorService.isMiracle) {
|
||||
modes.push("Miracle");
|
||||
} else {
|
||||
modes.push(I18n.tr("Compositor"));
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ Item {
|
||||
text: I18n.tr("Follow Monitor Focus")
|
||||
description: I18n.tr("Show workspaces of the currently focused monitor")
|
||||
checked: SettingsData.workspaceFollowFocus
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
||||
onToggled: checked => SettingsData.set("workspaceFollowFocus", checked)
|
||||
}
|
||||
|
||||
@@ -296,12 +296,12 @@ Item {
|
||||
height: 1
|
||||
color: Theme.outline
|
||||
opacity: 0.15
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
||||
}
|
||||
|
||||
SettingsButtonGroupRow {
|
||||
text: I18n.tr("Urgent Color")
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll
|
||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
||||
model: ["err", "pri", "sec", "s", "sc"]
|
||||
buttonHeight: 22
|
||||
minButtonWidth: 36
|
||||
|
||||
@@ -66,7 +66,7 @@ Singleton {
|
||||
return Hyprland.focusedWorkspace.monitor.name;
|
||||
if (CompositorService.isNiri && NiriService.currentOutput)
|
||||
return NiriService.currentOutput;
|
||||
if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
return focusedWs?.monitor?.name || "";
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ Singleton {
|
||||
property bool isDwl: false
|
||||
property bool isSway: false
|
||||
property bool isScroll: false
|
||||
property bool isMiracle: false
|
||||
property bool isLabwc: false
|
||||
property string compositor: "unknown"
|
||||
readonly property bool useHyprlandFocusGrab: isHyprland && Quickshell.env("DMS_HYPRLAND_EXCLUSIVE_FOCUS") !== "1"
|
||||
@@ -24,6 +25,7 @@ Singleton {
|
||||
readonly property string niriSocket: Quickshell.env("NIRI_SOCKET")
|
||||
readonly property string swaySocket: Quickshell.env("SWAYSOCK")
|
||||
readonly property string scrollSocket: Quickshell.env("SWAYSOCK")
|
||||
readonly property string miracleSocket: Quickshell.env("MIRACLESOCK")
|
||||
readonly property string labwcPid: Quickshell.env("LABWC_PID")
|
||||
property bool useNiriSorting: isNiri && NiriService
|
||||
|
||||
@@ -74,7 +76,7 @@ Singleton {
|
||||
screenName = Hyprland.focusedWorkspace.monitor.name;
|
||||
else if (isNiri && NiriService.currentOutput)
|
||||
screenName = NiriService.currentOutput;
|
||||
else if (isSway || isScroll) {
|
||||
else if (isSway || isScroll || isMiracle) {
|
||||
const focusedWs = I3.workspaces?.values?.find(ws => ws.focused === true);
|
||||
screenName = focusedWs?.monitor?.name || "";
|
||||
} else if (isDwl && DwlService.activeOutput)
|
||||
@@ -443,12 +445,13 @@ Singleton {
|
||||
}
|
||||
|
||||
function detectCompositor() {
|
||||
if (hyprlandSignature && hyprlandSignature.length > 0 && !niriSocket && !swaySocket && !scrollSocket && !labwcPid) {
|
||||
if (hyprlandSignature && hyprlandSignature.length > 0 && !niriSocket && !swaySocket && !scrollSocket && !miracleSocket && !labwcPid) {
|
||||
isHyprland = true;
|
||||
isNiri = false;
|
||||
isDwl = false;
|
||||
isSway = false;
|
||||
isScroll = false;
|
||||
isMiracle = false;
|
||||
isLabwc = false;
|
||||
compositor = "hyprland";
|
||||
console.info("CompositorService: Detected Hyprland");
|
||||
@@ -463,6 +466,7 @@ Singleton {
|
||||
isDwl = false;
|
||||
isSway = false;
|
||||
isScroll = false;
|
||||
isMiracle = false;
|
||||
isLabwc = false;
|
||||
compositor = "niri";
|
||||
console.info("CompositorService: Detected Niri with socket:", niriSocket);
|
||||
@@ -472,7 +476,7 @@ Singleton {
|
||||
return;
|
||||
}
|
||||
|
||||
if (swaySocket && swaySocket.length > 0 && !scrollSocket && scrollSocket.length == 0) {
|
||||
if (swaySocket && swaySocket.length > 0 && !scrollSocket && scrollSocket.length == 0 && !miracleSocket) {
|
||||
Proc.runCommand("swaySocketCheck", ["test", "-S", swaySocket], (output, exitCode) => {
|
||||
if (exitCode === 0) {
|
||||
isNiri = false;
|
||||
@@ -480,6 +484,7 @@ Singleton {
|
||||
isDwl = false;
|
||||
isSway = true;
|
||||
isScroll = false;
|
||||
isMiracle = false;
|
||||
isLabwc = false;
|
||||
compositor = "sway";
|
||||
console.info("CompositorService: Detected Sway with socket:", swaySocket);
|
||||
@@ -488,7 +493,24 @@ Singleton {
|
||||
return;
|
||||
}
|
||||
|
||||
if (scrollSocket && scrollSocket.length > 0) {
|
||||
if (miracleSocket && miracleSocket.length > 0) {
|
||||
Proc.runCommand("miracleSocketCheck", ["test", "-S", miracleSocket], (output, exitCode) => {
|
||||
if (exitCode === 0) {
|
||||
isNiri = false;
|
||||
isHyprland = false;
|
||||
isDwl = false;
|
||||
isSway = false;
|
||||
isScroll = false;
|
||||
isMiracle = true;
|
||||
isLabwc = false;
|
||||
compositor = "miracle";
|
||||
console.info("CompositorService: Detected Miracle WM with socket:", miracleSocket);
|
||||
}
|
||||
}, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (scrollSocket && scrollSocket.length > 0 && !miracleSocket) {
|
||||
Proc.runCommand("scrollSocketCheck", ["test", "-S", scrollSocket], (output, exitCode) => {
|
||||
if (exitCode === 0) {
|
||||
isNiri = false;
|
||||
@@ -496,6 +518,7 @@ Singleton {
|
||||
isDwl = false;
|
||||
isSway = false;
|
||||
isScroll = true;
|
||||
isMiracle = false;
|
||||
isLabwc = false;
|
||||
compositor = "scroll";
|
||||
console.info("CompositorService: Detected Scroll with socket:", scrollSocket);
|
||||
@@ -510,6 +533,7 @@ Singleton {
|
||||
isDwl = false;
|
||||
isSway = false;
|
||||
isScroll = false;
|
||||
isMiracle = false;
|
||||
isLabwc = true;
|
||||
compositor = "labwc";
|
||||
console.info("CompositorService: Detected LabWC with PID:", labwcPid);
|
||||
@@ -524,6 +548,7 @@ Singleton {
|
||||
isDwl = false;
|
||||
isSway = false;
|
||||
isScroll = false;
|
||||
isMiracle = false;
|
||||
isLabwc = false;
|
||||
compositor = "unknown";
|
||||
console.warn("CompositorService: No compositor detected");
|
||||
@@ -546,6 +571,7 @@ Singleton {
|
||||
isDwl = true;
|
||||
isSway = false;
|
||||
isScroll = false;
|
||||
isMiracle = false;
|
||||
isLabwc = false;
|
||||
compositor = "dwl";
|
||||
console.info("CompositorService: Detected DWL via DMS capability");
|
||||
@@ -559,7 +585,7 @@ Singleton {
|
||||
return Hyprland.dispatch("dpms off");
|
||||
if (isDwl)
|
||||
return _dwlPowerOffMonitors();
|
||||
if (isSway || isScroll) {
|
||||
if (isSway || isScroll || isMiracle) {
|
||||
try {
|
||||
I3.dispatch("output * dpms off");
|
||||
} catch (_) {}
|
||||
@@ -578,7 +604,7 @@ Singleton {
|
||||
return Hyprland.dispatch("dpms on");
|
||||
if (isDwl)
|
||||
return _dwlPowerOnMonitors();
|
||||
if (isSway || isScroll) {
|
||||
if (isSway || isScroll || isMiracle) {
|
||||
try {
|
||||
I3.dispatch("output * dpms on");
|
||||
} catch (_) {}
|
||||
|
||||
@@ -11,83 +11,83 @@ Singleton {
|
||||
property var groups: []
|
||||
property var _cachedWorkspaces: ({})
|
||||
|
||||
signal stateChanged()
|
||||
signal stateChanged
|
||||
|
||||
Connections {
|
||||
target: DMSService
|
||||
function onCapabilitiesReceived() {
|
||||
checkCapabilities()
|
||||
checkCapabilities();
|
||||
}
|
||||
function onConnectionStateChanged() {
|
||||
if (DMSService.isConnected) {
|
||||
checkCapabilities()
|
||||
checkCapabilities();
|
||||
} else {
|
||||
extWorkspaceAvailable = false
|
||||
extWorkspaceAvailable = false;
|
||||
}
|
||||
}
|
||||
function onExtWorkspaceStateUpdate(data) {
|
||||
if (extWorkspaceAvailable) {
|
||||
handleStateUpdate(data)
|
||||
handleStateUpdate(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (DMSService.dmsAvailable) {
|
||||
checkCapabilities()
|
||||
checkCapabilities();
|
||||
}
|
||||
}
|
||||
|
||||
function checkCapabilities() {
|
||||
if (!DMSService.capabilities || !Array.isArray(DMSService.capabilities)) {
|
||||
extWorkspaceAvailable = false
|
||||
return
|
||||
extWorkspaceAvailable = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const hasExtWorkspace = DMSService.capabilities.includes("extworkspace")
|
||||
const hasExtWorkspace = DMSService.capabilities.includes("extworkspace");
|
||||
if (hasExtWorkspace && !extWorkspaceAvailable) {
|
||||
if (typeof CompositorService !== "undefined") {
|
||||
const useExtWorkspace = DMSService.forceExtWorkspace || (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isDwl && !CompositorService.isSway && !CompositorService.isScroll)
|
||||
const useExtWorkspace = DMSService.forceExtWorkspace || (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isDwl && !CompositorService.isSway && !CompositorService.isScroll && !CompositorService.isMiracle);
|
||||
if (!useExtWorkspace) {
|
||||
console.info("ExtWorkspaceService: ext-workspace available but compositor has native support")
|
||||
extWorkspaceAvailable = false
|
||||
return
|
||||
console.info("ExtWorkspaceService: ext-workspace available but compositor has native support");
|
||||
extWorkspaceAvailable = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
extWorkspaceAvailable = true
|
||||
console.info("ExtWorkspaceService: ext-workspace capability detected")
|
||||
DMSService.addSubscription("extworkspace")
|
||||
requestState()
|
||||
extWorkspaceAvailable = true;
|
||||
console.info("ExtWorkspaceService: ext-workspace capability detected");
|
||||
DMSService.addSubscription("extworkspace");
|
||||
requestState();
|
||||
} else if (!hasExtWorkspace) {
|
||||
extWorkspaceAvailable = false
|
||||
extWorkspaceAvailable = false;
|
||||
}
|
||||
}
|
||||
|
||||
function requestState() {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.getState", null, response => {
|
||||
if (response.result) {
|
||||
handleStateUpdate(response.result)
|
||||
handleStateUpdate(response.result);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function handleStateUpdate(state) {
|
||||
groups = state.groups || []
|
||||
groups = state.groups || [];
|
||||
if (groups.length === 0) {
|
||||
console.warn("ExtWorkspaceService: Received empty workspace groups from backend")
|
||||
console.warn("ExtWorkspaceService: Received empty workspace groups from backend");
|
||||
} else {
|
||||
console.log("ExtWorkspaceService: Updated with", groups.length, "workspace groups")
|
||||
console.log("ExtWorkspaceService: Updated with", groups.length, "workspace groups");
|
||||
}
|
||||
stateChanged()
|
||||
stateChanged();
|
||||
}
|
||||
|
||||
function activateWorkspace(workspaceID, groupID = "") {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.activateWorkspace", {
|
||||
@@ -95,14 +95,14 @@ Singleton {
|
||||
"groupID": groupID
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: activateWorkspace error:", response.error)
|
||||
console.warn("ExtWorkspaceService: activateWorkspace error:", response.error);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function deactivateWorkspace(workspaceID, groupID = "") {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.deactivateWorkspace", {
|
||||
@@ -110,14 +110,14 @@ Singleton {
|
||||
"groupID": groupID
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: deactivateWorkspace error:", response.error)
|
||||
console.warn("ExtWorkspaceService: deactivateWorkspace error:", response.error);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function removeWorkspace(workspaceID, groupID = "") {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.removeWorkspace", {
|
||||
@@ -125,14 +125,14 @@ Singleton {
|
||||
"groupID": groupID
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: removeWorkspace error:", response.error)
|
||||
console.warn("ExtWorkspaceService: removeWorkspace error:", response.error);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
function createWorkspace(groupID, name) {
|
||||
if (!DMSService.isConnected || !extWorkspaceAvailable) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
DMSService.sendRequest("extworkspace.createWorkspace", {
|
||||
@@ -140,134 +140,138 @@ Singleton {
|
||||
"name": name
|
||||
}, response => {
|
||||
if (response.error) {
|
||||
console.warn("ExtWorkspaceService: createWorkspace error:", 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 group;
|
||||
}
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
function getWorkspacesForOutput(outputName) {
|
||||
const group = getGroupForOutput(outputName)
|
||||
return group ? (group.workspaces || []) : []
|
||||
const group = getGroupForOutput(outputName);
|
||||
return group ? (group.workspaces || []) : [];
|
||||
}
|
||||
|
||||
function getActiveWorkspaces() {
|
||||
const active = []
|
||||
const active = [];
|
||||
for (const group of groups) {
|
||||
if (!group.workspaces) continue
|
||||
if (!group.workspaces)
|
||||
continue;
|
||||
for (const ws of group.workspaces) {
|
||||
if (ws.active) {
|
||||
active.push({
|
||||
workspace: ws,
|
||||
group: group,
|
||||
outputs: group.outputs || []
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return active
|
||||
return active;
|
||||
}
|
||||
|
||||
function getActiveWorkspaceForOutput(outputName) {
|
||||
const group = getGroupForOutput(outputName)
|
||||
if (!group || !group.workspaces) return null
|
||||
const group = getGroupForOutput(outputName);
|
||||
if (!group || !group.workspaces)
|
||||
return null;
|
||||
|
||||
for (const ws of group.workspaces) {
|
||||
if (ws.active) {
|
||||
return ws
|
||||
return ws;
|
||||
}
|
||||
}
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
function getVisibleWorkspaces(outputName) {
|
||||
const workspaces = getWorkspacesForOutput(outputName)
|
||||
let visible = workspaces.filter(ws => !ws.hidden)
|
||||
const workspaces = getWorkspacesForOutput(outputName);
|
||||
let visible = workspaces.filter(ws => !ws.hidden);
|
||||
|
||||
const hasValidCoordinates = visible.some(ws => ws.coordinates && ws.coordinates.length > 0)
|
||||
const hasValidCoordinates = visible.some(ws => ws.coordinates && ws.coordinates.length > 0);
|
||||
if (hasValidCoordinates) {
|
||||
visible = visible.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 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
|
||||
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)
|
||||
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
|
||||
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
|
||||
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
|
||||
return cache.workspaces;
|
||||
}
|
||||
|
||||
function getUrgentWorkspaces() {
|
||||
const urgent = []
|
||||
const urgent = [];
|
||||
for (const group of groups) {
|
||||
if (!group.workspaces) continue
|
||||
if (!group.workspaces)
|
||||
continue;
|
||||
for (const ws of group.workspaces) {
|
||||
if (ws.urgent) {
|
||||
urgent.push({
|
||||
workspace: ws,
|
||||
group: group,
|
||||
outputs: group.outputs || []
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
return urgent
|
||||
return urgent;
|
||||
}
|
||||
|
||||
function switchToWorkspace(outputName, workspaceName) {
|
||||
const workspaces = getWorkspacesForOutput(outputName)
|
||||
const workspaces = getWorkspacesForOutput(outputName);
|
||||
for (const ws of workspaces) {
|
||||
if (ws.name === workspaceName || ws.id === workspaceName) {
|
||||
activateWorkspace(ws.name || ws.id)
|
||||
return
|
||||
activateWorkspace(ws.name || ws.id);
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.warn("ExtWorkspaceService: workspace not found:", workspaceName)
|
||||
console.warn("ExtWorkspaceService: workspace not found:", workspaceName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ Singleton {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CompositorService.isSway || CompositorService.isScroll) {
|
||||
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
|
||||
try {
|
||||
I3.dispatch("exit");
|
||||
} catch (_) {}
|
||||
|
||||
1198
quickshell/assets/miraclewm.svg
Normal file
1198
quickshell/assets/miraclewm.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 131 KiB |
Reference in New Issue
Block a user