1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-02 03:28:28 -04:00

feat(mango): first-class MangoWM support across DMS, dankinstaller & UI tools

- Bring up Mango to parity with niri/hyprland via a native JSON-IPC w/Native MangoServic., replaces the legacy dwl/`mmsg` path and recent breaking changes
- Dankinstall: mango supported installer, config/binds templates, and packaging (Arch AUR, Fedora Terra auto-enable, Gentoo GURU)
- Window rules: Go provider + CLI + Settings GUI editor
- Keybinds + config reload on edit (mmsg dispatch reload_config)
- Misc new supported options in DMS settings
This commit is contained in:
purian23
2026-06-04 18:45:04 -04:00
parent 4181343ef3
commit 8eb23bcc29
63 changed files with 2282 additions and 301 deletions
+4
View File
@@ -110,6 +110,8 @@ Item {
focusedScreenName = focusedWs?.monitor?.name || "";
} else if (CompositorService.isDwl && DwlService.activeOutput) {
focusedScreenName = DwlService.activeOutput;
} else if (CompositorService.isMango && MangoService.activeOutput) {
focusedScreenName = MangoService.activeOutput;
}
if (!focusedScreenName && barVariants.instances.length > 0) {
@@ -139,6 +141,8 @@ Item {
focusedScreenName = focusedWs?.monitor?.name || "";
} else if (CompositorService.isDwl && DwlService.activeOutput) {
focusedScreenName = DwlService.activeOutput;
} else if (CompositorService.isMango && MangoService.activeOutput) {
focusedScreenName = MangoService.activeOutput;
}
if (!focusedScreenName && barVariants.instances.length > 0) {
+11 -10
View File
@@ -29,6 +29,7 @@ Item {
readonly property real _frameEdgeFloorInset: (SettingsData.frameEnabled && _usesFrameBarChrome) ? Math.max(0, SettingsData.frameThickness - _edgeBaseMargin) : 0
readonly property bool _barIsVertical: _hasBarWindow ? barWindow.isVertical : false
readonly property string _barScreenName: _hasBarWindow ? (barWindow.screenName || "") : ""
readonly property var dwlSvc: CompositorService.isMango ? MangoService : DwlService
readonly property bool hasAdjacentTopBarLive: _hasBarWindow && barWindow.hasAdjacentTopBar
readonly property bool hasAdjacentBottomBarLive: _hasBarWindow && barWindow.hasAdjacentBottomBar
readonly property bool hasAdjacentLeftBarLive: _hasBarWindow && barWindow.hasAdjacentLeftBar
@@ -189,16 +190,16 @@ Item {
}
return monitorWorkspaces.sort((a, b) => a.id - b.id);
} else if (CompositorService.isDwl) {
if (!DwlService.dwlAvailable) {
} else if (CompositorService.isDwl || CompositorService.isMango) {
if (!dwlSvc.available) {
return [0];
}
if (SettingsData.dwlShowAllTags) {
return Array.from({
length: DwlService.tagCount
length: dwlSvc.tagCount
}, (_, i) => i);
}
return DwlService.getVisibleTags(screenName);
return dwlSvc.getVisibleTags(screenName);
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
const workspaces = I3.workspaces?.values || [];
if (workspaces.length === 0)
@@ -234,13 +235,13 @@ Item {
const monitors = Hyprland.monitors?.values || [];
const currentMonitor = monitors.find(monitor => monitor.name === screenName);
return currentMonitor?.activeWorkspace?.id ?? 1;
} else if (CompositorService.isDwl) {
if (!DwlService.dwlAvailable)
} else if (CompositorService.isDwl || CompositorService.isMango) {
if (!dwlSvc.available)
return 0;
const outputState = DwlService.getOutputState(screenName);
const outputState = dwlSvc.getOutputState(screenName);
if (!outputState || !outputState.tags)
return 0;
const activeTags = DwlService.getActiveTags(screenName);
const activeTags = dwlSvc.getActiveTags(screenName);
return activeTags.length > 0 ? activeTags[0] : 0;
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
if (!screenName || SettingsData.workspaceFollowFocus) {
@@ -282,14 +283,14 @@ Item {
if (nextIndex !== validIndex) {
HyprlandService.focusWorkspace(realWorkspaces[nextIndex].id);
}
} else if (CompositorService.isDwl) {
} else if (CompositorService.isDwl || CompositorService.isMango) {
const currentTag = getCurrentWorkspace();
const currentIndex = realWorkspaces.findIndex(tag => tag === currentTag);
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) {
DwlService.switchToTag(_barScreenName, realWorkspaces[nextIndex]);
dwlSvc.switchToTag(_barScreenName, realWorkspaces[nextIndex]);
}
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
const currentWs = getCurrentWorkspace();
+20 -2
View File
@@ -327,6 +327,24 @@ PanelWindow {
hasMaximizedToplevel = false;
return;
}
if (CompositorService.isMango) {
const out = MangoService.outputs[screenName];
const active = new Set((out?.activeTags) || []);
const wins = MangoService.windows || [];
for (let i = 0; i < wins.length; i++) {
const w = wins[i];
if (!w || w.monitor !== screenName || w.is_minimized)
continue;
if (active.size > 0 && !(w.tags || []).some(t => active.has(t)))
continue;
if (w.is_maximized || w.is_fullscreen) {
hasMaximizedToplevel = true;
return;
}
}
hasMaximizedToplevel = false;
return;
}
if (!CompositorService.isHyprland && !CompositorService.isNiri) {
hasMaximizedToplevel = false;
return;
@@ -351,7 +369,7 @@ PanelWindow {
shouldHideForWindows = false;
return;
}
if (!CompositorService.isNiri && !CompositorService.isHyprland) {
if (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isMango) {
shouldHideForWindows = false;
return;
}
@@ -825,7 +843,7 @@ PanelWindow {
return true;
const showOnWindowsSetting = barConfig?.showOnWindowsOpen ?? false;
if (showOnWindowsSetting && autoHide && (CompositorService.isNiri || CompositorService.isHyprland)) {
if (showOnWindowsSetting && autoHide && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango)) {
if (barWindow.shouldHideForWindows)
return topBarMouseArea.containsMouse || popoutPinsReveal || revealSticky || ipcReveal;
return true;
@@ -10,6 +10,10 @@ DankPopout {
property var triggerScreen: null
// mango shares dwl's layout model; route to the right service.
readonly property bool isDwlLike: CompositorService.isDwl || CompositorService.isMango
readonly property var dwlSvc: CompositorService.isMango ? MangoService : DwlService
function setTriggerPosition(x, y, width, section, screen, barPosition, barThickness, barSpacing, barConfig) {
triggerX = x;
triggerY = y;
@@ -33,8 +37,8 @@ DankPopout {
onScreenChanged: updateOutputState()
function updateOutputState() {
if (screen && DwlService.dwlAvailable) {
outputState = DwlService.getOutputState(screen.name);
if (screen && root.dwlSvc.available) {
outputState = root.dwlSvc.getOutputState(screen.name);
} else {
outputState = null;
}
@@ -215,7 +219,7 @@ DankPopout {
spacing: Theme.spacingS
Repeater {
model: DwlService.layouts
model: root.dwlSvc.layouts
delegate: Rectangle {
required property string modelData
@@ -269,11 +273,11 @@ DankPopout {
if (!root.triggerScreen) {
return;
}
if (!DwlService.dwlAvailable) {
if (!root.dwlSvc.available) {
return;
}
DwlService.setLayout(root.triggerScreen.name, index);
root.dwlSvc.setLayout(root.triggerScreen.name, index);
root.close();
}
}
+1 -1
View File
@@ -282,7 +282,7 @@ Loader {
"cpuTemp": dgopAvailable,
"gpuTemp": dgopAvailable,
"network_speed_monitor": dgopAvailable,
"layout": CompositorService.isDwl && DwlService.dwlAvailable
"layout": (CompositorService.isDwl && DwlService.dwlAvailable) || (CompositorService.isMango && MangoService.available)
};
return widgetVisibility[widgetId] ?? true;
@@ -12,9 +12,13 @@ BasePill {
signal toggleLayoutPopup
visible: CompositorService.isDwl && DwlService.dwlAvailable
// mango shares dwl's tag/layout model; route to the right service.
readonly property bool isDwlLike: CompositorService.isDwl || CompositorService.isMango
readonly property var dwlSvc: CompositorService.isMango ? MangoService : DwlService
property var outputState: parentScreen ? DwlService.getOutputState(parentScreen.name) : null
visible: layout.isDwlLike && layout.dwlSvc.available
property var outputState: parentScreen ? layout.dwlSvc.getOutputState(parentScreen.name) : null
property string currentLayoutSymbol: outputState?.layoutSymbol || ""
property int currentLayoutIndex: outputState?.layout || 0
@@ -37,9 +41,9 @@ BasePill {
}
Connections {
target: DwlService
target: layout.dwlSvc
function onStateChanged() {
outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null;
outputState = parentScreen ? layout.dwlSvc.getOutputState(parentScreen.name) : null;
}
}
@@ -97,13 +101,13 @@ BasePill {
}
onRightClicked: {
if (!parentScreen || !DwlService.dwlAvailable || DwlService.layouts.length === 0) {
if (!parentScreen || !layout.dwlSvc.available || layout.dwlSvc.layouts.length === 0) {
return;
}
const currentIndex = layout.currentLayoutIndex;
const nextIndex = (currentIndex + 1) % DwlService.layouts.length;
const nextIndex = (currentIndex + 1) % layout.dwlSvc.layouts.length;
DwlService.setLayout(parentScreen.name, nextIndex);
layout.dwlSvc.setLayout(parentScreen.name, nextIndex);
}
}
@@ -114,6 +114,8 @@ BasePill {
return NiriService.getCurrentKeyboardLayoutName();
} else if (CompositorService.isDwl) {
return DwlService.currentKeyboardLayout;
} else if (CompositorService.isMango) {
return MangoService.currentKeyboardLayout;
}
return "";
}
@@ -208,7 +210,9 @@ BasePill {
} else if (CompositorService.isHyprland) {
Quickshell.execDetached(["hyprctl", "switchxkblayout", root.hyprlandKeyboard, "next"]);
} else if (CompositorService.isDwl) {
Quickshell.execDetached(["mmsg", "-d", "switch_keyboard_layout"]);
Quickshell.execDetached(["mmsg", "dispatch", "switch_keyboard_layout"]);
} else if (CompositorService.isMango) {
MangoService.cycleKeyboardLayout();
}
}
}
@@ -55,7 +55,7 @@ BasePill {
}
IconImage {
visible: SettingsData.launcherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
visible: SettingsData.launcherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
anchors.centerIn: parent
width: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
height: Theme.barIconSize(root.barThickness, SettingsData.launcherLogoSizeOffset, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
@@ -68,6 +68,8 @@ BasePill {
return "file://" + Theme.shellDir + "/assets/hyprland.svg";
} else if (CompositorService.isDwl) {
return "file://" + Theme.shellDir + "/assets/mango.png";
} else if (CompositorService.isMango) {
return "file://" + Theme.shellDir + "/assets/mango.png";
} else if (CompositorService.isSway) {
return "file://" + Theme.shellDir + "/assets/sway.svg";
} else if (CompositorService.isScroll) {
@@ -22,6 +22,11 @@ Item {
property var hyprlandOverviewLoader: null
property var parentScreen: null
// mango shares dwl's tag model; route to the right service so one set of
// branches serves both.
readonly property bool isDwlLike: CompositorService.isDwl || CompositorService.isMango
readonly property var dwlSvc: CompositorService.isMango ? MangoService : DwlService
readonly property real _leftMargin: {
if (isVertical)
return 0;
@@ -76,7 +81,8 @@ Item {
case "hyprland":
return Hyprland.focusedWorkspace?.monitor?.name || root.screenName;
case "dwl":
return DwlService.activeOutput || root.screenName;
case "mango":
return root.dwlSvc.activeOutput || root.screenName;
case "sway":
case "scroll":
case "miracle":
@@ -95,6 +101,7 @@ Item {
case "niri":
case "hyprland":
case "dwl":
case "mango":
case "sway":
case "scroll":
case "miracle":
@@ -121,6 +128,7 @@ Item {
case "hyprland":
return getHyprlandActiveWorkspace();
case "dwl":
case "mango":
const activeTags = getDwlActiveTags();
return activeTags.length > 0 ? activeTags[0] : -1;
case "sway":
@@ -132,7 +140,7 @@ Item {
}
}
property var dwlActiveTags: {
if (CompositorService.isDwl) {
if (root.isDwlLike) {
return getDwlActiveTags();
}
return [];
@@ -152,6 +160,7 @@ Item {
baseList = getHyprlandWorkspaces();
break;
case "dwl":
case "mango":
baseList = getDwlTags();
break;
case "sway":
@@ -288,7 +297,7 @@ Item {
}
} else if (CompositorService.isHyprland) {
targetWorkspaceId = ws.id !== undefined ? ws.id : ws;
} else if (CompositorService.isDwl) {
} else if (root.isDwlLike) {
if (typeof ws !== "object" || ws.tag === undefined) {
return [];
}
@@ -308,8 +317,8 @@ Item {
} 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) {
const output = DwlService.getOutputState(root.effectiveScreenName);
} else if (root.isDwlLike) {
const output = root.dwlSvc.getOutputState(root.effectiveScreenName);
if (output && output.tags) {
const tag = output.tags.find(t => t.tag === targetWorkspaceId);
isActiveWs = tag ? (tag.state === 1) : false;
@@ -323,19 +332,25 @@ Item {
return;
}
let winWs = null;
if (CompositorService.isNiri) {
winWs = w.workspace_id;
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
winWs = w.workspace?.num;
if (CompositorService.isMango) {
// mangoTags are 1-based; targetWorkspaceId is 0-based.
if (!(w.mangoTags || []).includes(targetWorkspaceId + 1))
return;
} else {
const hyprlandToplevels = Array.from(Hyprland.toplevels?.values || []);
const hyprToplevel = hyprlandToplevels.find(ht => ht.wayland === w);
winWs = hyprToplevel?.workspace?.id;
}
let winWs = null;
if (CompositorService.isNiri) {
winWs = w.workspace_id;
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
winWs = w.workspace?.num;
} else {
const hyprlandToplevels = Array.from(Hyprland.toplevels?.values || []);
const hyprToplevel = hyprlandToplevels.find(ht => ht.wayland === w);
winWs = hyprToplevel?.workspace?.id;
}
if (winWs === undefined || winWs === null || winWs !== targetWorkspaceId) {
return;
if (winWs === undefined || winWs === null || winWs !== targetWorkspaceId) {
return;
}
}
const keyBase = (w.app_id || w.appId || w.class || w.windowClass || "unknown");
@@ -391,7 +406,7 @@ Item {
"id": -1,
"name": ""
};
} else if (CompositorService.isDwl) {
} else if (root.isDwlLike) {
placeholder = {
"tag": -1
};
@@ -473,11 +488,11 @@ Item {
}
function getDwlTags() {
if (!DwlService.dwlAvailable)
if (!root.dwlSvc.available)
return [];
const targetScreen = root.effectiveScreenName;
const output = DwlService.getOutputState(targetScreen);
const output = root.dwlSvc.getOutputState(targetScreen);
if (!output || !output.tags || output.tags.length === 0)
return [];
@@ -490,7 +505,7 @@ Item {
}));
}
const visibleTagIndices = DwlService.getVisibleTags(targetScreen);
const visibleTagIndices = root.dwlSvc.getVisibleTags(targetScreen);
return visibleTagIndices.map(tagIndex => {
const tagData = output.tags.find(t => t.tag === tagIndex);
return {
@@ -503,10 +518,10 @@ Item {
}
function getDwlActiveTags() {
if (!DwlService.dwlAvailable)
if (!root.dwlSvc.available)
return [];
return DwlService.getActiveTags(root.effectiveScreenName);
return root.dwlSvc.getActiveTags(root.effectiveScreenName);
}
function getExtWorkspaceWorkspaces() {
@@ -557,7 +572,7 @@ Item {
return ws && ws.idx !== -1;
if (CompositorService.isHyprland)
return ws && ws.id !== -1;
if (CompositorService.isDwl)
if (root.isDwlLike)
return ws && ws.tag !== -1;
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
return ws && ws.num !== -1;
@@ -586,8 +601,9 @@ Item {
}
break;
case "dwl":
case "mango":
if (data.tag !== undefined)
DwlService.switchToTag(root.screenName, data.tag);
root.dwlSvc.switchToTag(root.screenName, data.tag);
break;
case "sway":
case "scroll":
@@ -673,7 +689,7 @@ Item {
}
HyprlandService.focusWorkspace(realWorkspaces[nextIndex].id);
} else if (CompositorService.isDwl) {
} else if (root.isDwlLike) {
const realWorkspaces = getRealWorkspaces();
if (realWorkspaces.length < 2) {
return;
@@ -687,7 +703,7 @@ Item {
return;
}
DwlService.switchToTag(root.screenName, realWorkspaces[nextIndex].tag);
root.dwlSvc.switchToTag(root.screenName, realWorkspaces[nextIndex].tag);
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
const realWorkspaces = getRealWorkspaces();
if (realWorkspaces.length < 2) {
@@ -715,7 +731,7 @@ Item {
return (modelData?.idx !== undefined && modelData?.idx !== -1) ? modelData.idx : "";
if (CompositorService.isHyprland)
return modelData?.id || "";
if (CompositorService.isDwl)
if (root.isDwlLike)
return (modelData?.tag !== undefined) ? (modelData.tag + 1) : "";
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
return modelData?.num || "";
@@ -730,7 +746,7 @@ Item {
isPlaceholder = modelData?.idx === -1;
} else if (CompositorService.isHyprland) {
isPlaceholder = modelData?.id === -1;
} else if (CompositorService.isDwl) {
} else if (root.isDwlLike) {
isPlaceholder = modelData?.tag === -1;
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
isPlaceholder = modelData?.num === -1;
@@ -765,7 +781,7 @@ Item {
return getWorkspaceIndexFallback(modelData, index);
}
readonly property bool hasNativeWorkspaceSupport: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
readonly property bool hasNativeWorkspaceSupport: CompositorService.isNiri || CompositorService.isHyprland || root.isDwlLike || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
readonly property bool hasWorkspaces: getRealWorkspaces().length > 0
readonly property bool shouldShow: hasNativeWorkspaceSupport || (useExtWorkspace && hasWorkspaces)
@@ -983,7 +999,7 @@ Item {
return !!(modelData && modelData.idx === root.currentWorkspace);
if (CompositorService.isHyprland)
return !!(modelData && modelData.id === root.currentWorkspace);
if (CompositorService.isDwl)
if (root.isDwlLike)
return !!(modelData && root.dwlActiveTags.includes(modelData.tag));
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
return !!(modelData && modelData.num === root.currentWorkspace);
@@ -992,7 +1008,7 @@ Item {
property bool isOccupied: {
if (CompositorService.isHyprland)
return Array.from(Hyprland.toplevels?.values || []).some(tl => tl.workspace?.id === modelData?.id);
if (CompositorService.isDwl)
if (root.isDwlLike)
return modelData.clients > 0;
if (CompositorService.isNiri) {
const workspace = NiriService.allWorkspaces.find(ws => ws.idx + 1 === modelData && ws.output === root.effectiveScreenName);
@@ -1007,7 +1023,7 @@ Item {
return !!(modelData && modelData.idx === -1);
if (CompositorService.isHyprland)
return !!(modelData && modelData.id === -1);
if (CompositorService.isDwl)
if (root.isDwlLike)
return !!(modelData && modelData.tag === -1);
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
return !!(modelData && modelData.num === -1);
@@ -1024,7 +1040,7 @@ Item {
return modelData?.urgent ?? false;
if (CompositorService.isNiri)
return loadedIsUrgent;
if (CompositorService.isDwl)
if (root.isDwlLike)
return modelData?.state === 2;
if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle)
return loadedIsUrgent;
@@ -1081,8 +1097,12 @@ Item {
winWs = hyprToplevel?.workspace?.id;
}
if (winWs !== targetWorkspaceId)
if (CompositorService.isMango) {
if (!(w.mangoTags || []).includes(targetWorkspaceId + 1))
continue;
} else if (winWs !== targetWorkspaceId) {
continue;
}
totalCount++;
const appKey = w.app_id || w.appId || w.class || w.windowClass || "unknown";
@@ -1311,8 +1331,8 @@ Item {
}
} else if (CompositorService.isHyprland && modelData?.id) {
HyprlandService.focusWorkspace(modelData.id);
} else if (CompositorService.isDwl && modelData?.tag !== undefined) {
DwlService.switchToTag(root.screenName, modelData.tag);
} else if (root.isDwlLike && modelData?.tag !== undefined) {
root.dwlSvc.switchToTag(root.screenName, modelData.tag);
} else if ((CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) && modelData?.num) {
try {
I3.dispatch(`workspace number ${modelData.num}`);
@@ -1323,8 +1343,8 @@ Item {
NiriService.toggleOverview();
} else if (CompositorService.isHyprland && root.hyprlandOverviewLoader?.item) {
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen;
} else if (CompositorService.isDwl && modelData?.tag !== undefined) {
DwlService.toggleTag(root.screenName, modelData.tag);
} else if (root.isDwlLike && modelData?.tag !== undefined) {
root.dwlSvc.toggleTag(root.screenName, modelData.tag);
}
}
}
@@ -1348,7 +1368,7 @@ Item {
wsData = modelData || null;
} else if (CompositorService.isHyprland) {
wsData = modelData;
} else if (CompositorService.isDwl) {
} else if (root.isDwlLike) {
wsData = modelData;
} else if (CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
wsData = modelData;
@@ -1362,7 +1382,7 @@ Item {
}
if (SettingsData.showWorkspaceApps) {
if (CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
if (root.isDwlLike || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle) {
delegateRoot.loadedIcons = root.getWorkspaceIcons(modelData);
} else if (CompositorService.isNiri) {
delegateRoot.loadedIcons = root.getWorkspaceIcons(isPlaceholder ? null : modelData);
@@ -1922,8 +1942,8 @@ Item {
}
}
Connections {
target: DwlService
enabled: CompositorService.isDwl
target: root.dwlSvc
enabled: root.isDwlLike
function onStateChanged() {
delegateRoot.updateAllData();
}
@@ -70,6 +70,8 @@ Card {
// technically they might not be on mangowc, but its what we support in the docs
if (CompositorService.isDwl)
return I18n.tr("on MangoWC");
if (CompositorService.isMango)
return I18n.tr("on MangoWC");
if (CompositorService.isSway)
return I18n.tr("on Sway");
if (CompositorService.isScroll)
+7 -1
View File
@@ -227,7 +227,7 @@ Variants {
readonly property bool shouldHideForWindows: {
if (!SettingsData.dockSmartAutoHide)
return false;
if (!CompositorService.isNiri && !CompositorService.isHyprland)
if (!CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isMango)
return false;
const screenName = dock.modelData?.name ?? "";
@@ -291,6 +291,12 @@ Variants {
return false;
}
if (CompositorService.isMango) {
MangoService.windows;
MangoService.outputs;
return CompositorService.mangoDockOverlapForSmartAutoHide(screenName, SettingsData.dockPosition, dockThickness, screenWidth, screenHeight);
}
// Hyprland implementation (current workspace + visible special workspaces)
Hyprland.focusedWorkspace;
Hyprland.toplevels;
@@ -236,7 +236,7 @@ Item {
}
IconImage {
visible: SettingsData.dockLauncherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
visible: SettingsData.dockLauncherLogoMode === "compositor" && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle || CompositorService.isLabwc)
anchors.centerIn: parent
width: actualIconSize + SettingsData.dockLauncherLogoSizeOffset
height: actualIconSize + SettingsData.dockLauncherLogoSizeOffset
@@ -249,6 +249,8 @@ Item {
return "file://" + Theme.shellDir + "/assets/hyprland.svg";
} else if (CompositorService.isDwl) {
return "file://" + Theme.shellDir + "/assets/mango.png";
} else if (CompositorService.isMango) {
return "file://" + Theme.shellDir + "/assets/mango.png";
} else if (CompositorService.isSway) {
return "file://" + Theme.shellDir + "/assets/sway.svg";
} else if (CompositorService.isScroll) {
+2 -2
View File
@@ -429,9 +429,9 @@ MIRACLE_EOF
mango|mangowc)
require_command "mango"
if [[ -n "$COMPOSITOR_CONFIG" ]]; then
exec_compositor "mango" mango -c "$COMPOSITOR_CONFIG" -s "$QS_CMD && mmsg -d quit"
exec_compositor "mango" mango -c "$COMPOSITOR_CONFIG" -s "$QS_CMD && mmsg dispatch quit"
else
exec_compositor "mango" mango -s "$QS_CMD && mmsg -d quit"
exec_compositor "mango" mango -s "$QS_CMD && mmsg dispatch quit"
fi
;;
+1 -1
View File
@@ -15,7 +15,7 @@ Item {
property bool isSway: CompositorService.isSway
property bool isScroll: CompositorService.isScroll
property bool isMiracle: CompositorService.isMiracle
property bool isDwl: CompositorService.isDwl
property bool isDwl: CompositorService.isDwl || CompositorService.isMango
property bool isLabwc: CompositorService.isLabwc
property string compositorName: {
+2 -2
View File
@@ -659,7 +659,7 @@ Item {
SettingsToggleRow {
width: parent.width - parent.leftPadding
visible: CompositorService.isNiri || CompositorService.isHyprland
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
text: I18n.tr("Hide When Windows Open")
description: I18n.tr("Show the bar only when no windows are open")
checked: selectedBarConfig?.showOnWindowsOpen ?? false
@@ -1144,7 +1144,7 @@ Item {
iconName: "fit_screen"
title: I18n.tr("Maximize Detection")
description: I18n.tr("Remove gaps and border when windows are maximized")
visible: selectedBarConfig?.enabled && (CompositorService.isNiri || CompositorService.isHyprland)
visible: selectedBarConfig?.enabled && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango)
checked: selectedBarConfig?.maximizeDetection ?? true
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
maximizeDetection: checked
@@ -158,12 +158,14 @@ Singleton {
const compositorDirs = {
"niri": configDir + "/niri/dms/profiles",
"hyprland": configDir + "/hypr/dms/profiles",
"dwl": configDir + "/mango/dms/profiles"
"dwl": configDir + "/mango/dms/profiles",
"mango": configDir + "/mango/dms/profiles"
};
const compositorExts = {
"niri": ".kdl",
"hyprland": ".conf",
"dwl": ".conf"
"dwl": ".conf",
"mango": ".conf"
};
const tasks = [];
@@ -542,6 +544,14 @@ Singleton {
onWriteFailed();
});
break;
case "mango":
MangoService.generateOutputsConfig(outputsData, success => {
if (success)
onWriteSuccess();
else
onWriteFailed();
});
break;
case "dwl":
DwlService.generateOutputsConfig(outputsData, success => {
if (success)
@@ -1032,6 +1042,7 @@ Singleton {
case "hyprland":
return parseHyprlandOutputs(content);
case "dwl":
case "mango":
return parseMangoOutputs(content);
default:
return {};
@@ -1302,7 +1313,7 @@ Singleton {
params[pair.substring(0, colonIdx).trim()] = pair.substring(colonIdx + 1).trim();
}
const name = params.name;
const name = (params.name || "").replace(/^\^/, "").replace(/\$$/, "");
if (!name)
continue;
@@ -1370,6 +1381,7 @@ Singleton {
"includeLine": "require(\"dms.outputs\")"
};
case "dwl":
case "mango":
return {
"configFile": configDir + "/mango/config.conf",
"outputsFile": configDir + "/mango/dms/outputs.conf",
@@ -1383,7 +1395,7 @@ Singleton {
function checkIncludeStatus() {
const compositor = CompositorService.compositor;
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "dwl") {
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "dwl" && compositor !== "mango") {
includeStatus = {
"exists": false,
"included": false,
@@ -1394,7 +1406,8 @@ Singleton {
}
const filename = (compositor === "niri") ? "outputs.kdl" : ((compositor === "hyprland") ? "outputs.lua" : "outputs.conf");
const compositorArg = (compositor === "dwl") ? "mangowc" : compositor;
// mango and dwl both use outputs.conf under ~/.config/mango
const compositorArg = (compositor === "dwl" || compositor === "mango") ? "mangowc" : compositor;
checkingInclude = true;
Proc.runCommand("check-outputs-include", ["dms", "config", "resolve-include", compositorArg, filename], (output, exitCode) => {
@@ -1569,6 +1582,9 @@ Singleton {
}
HyprlandService.generateOutputsConfig(outputsData, buildMergedHyprlandSettings());
break;
case "mango":
MangoService.generateOutputsConfig(outputsData);
break;
case "dwl":
DwlService.generateOutputsConfig(outputsData);
break;
@@ -317,7 +317,7 @@ StyledRect {
DankToggle {
width: parent.width
text: I18n.tr("Variable Refresh Rate")
visible: root.isConnected && !root.isDisabled && !CompositorService.isDwl && !CompositorService.isHyprland && !CompositorService.isNiri && (DisplayConfigState.outputs[root.outputName]?.vrr_supported ?? false)
visible: root.isConnected && !root.isDisabled && !CompositorService.isDwl && !CompositorService.isMango && !CompositorService.isHyprland && !CompositorService.isNiri && (DisplayConfigState.outputs[root.outputName]?.vrr_supported ?? false)
checked: {
const pendingVrr = DisplayConfigState.getPendingValue(root.outputName, "vrr");
if (pendingVrr !== undefined)
@@ -500,7 +500,7 @@ Item {
Column {
id: displayFormatColumn
visible: !CompositorService.isDwl
visible: !CompositorService.isDwl && !CompositorService.isMango
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
+3 -1
View File
@@ -70,7 +70,7 @@ Item {
text: I18n.tr("Intelligent Auto-hide")
description: I18n.tr("Show dock when floating windows don't overlap its area")
checked: SettingsData.dockSmartAutoHide
visible: SettingsData.showDock && (CompositorService.isNiri || CompositorService.isHyprland)
visible: SettingsData.showDock && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango)
onToggled: checked => {
if (checked && SettingsData.dockAutoHide) {
SettingsData.set("dockAutoHide", false);
@@ -284,6 +284,8 @@ Item {
modes.push("Hyprland");
} else if (CompositorService.isDwl) {
modes.push("mango");
} else if (CompositorService.isMango) {
modes.push("mango");
} else if (CompositorService.isSway) {
modes.push("Sway");
} else if (CompositorService.isScroll) {
@@ -306,6 +306,8 @@ Item {
modes.push("Hyprland");
} else if (CompositorService.isDwl) {
modes.push("mango");
} else if (CompositorService.isMango) {
modes.push("mango");
} else if (CompositorService.isSway) {
modes.push("Sway");
} else if (CompositorService.isScroll) {
+12 -5
View File
@@ -49,6 +49,7 @@ Item {
"includeLine": "require(\"dms.cursor\")"
};
case "dwl":
case "mango":
return {
"configFile": configDir + "/mango/config.conf",
"cursorFile": configDir + "/mango/dms/cursor.conf",
@@ -62,7 +63,7 @@ Item {
function checkCursorIncludeStatus() {
const compositor = CompositorService.compositor;
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "dwl") {
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "dwl" && compositor !== "mango") {
cursorIncludeStatus = {
"exists": false,
"included": false,
@@ -73,7 +74,7 @@ Item {
}
const filename = (compositor === "niri") ? "cursor.kdl" : ((compositor === "hyprland") ? "cursor.lua" : "cursor.conf");
const compositorArg = (compositor === "dwl") ? "mangowc" : compositor;
const compositorArg = (compositor === "dwl" || compositor === "mango") ? "mangowc" : compositor;
checkingCursorInclude = true;
Proc.runCommand("check-cursor-include", ["dms", "config", "resolve-include", compositorArg, filename], (output, exitCode) => {
@@ -193,7 +194,7 @@ Item {
themeColorsTab.templateDetection = JSON.parse(output.trim());
} catch (e) {}
});
if (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl)
if (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango)
checkCursorIncludeStatus();
}
@@ -2177,7 +2178,7 @@ Item {
title: I18n.tr("MangoWC Layout Overrides")
settingKey: "mangoLayout"
iconName: "crop_square"
visible: CompositorService.isDwl
visible: CompositorService.isDwl || CompositorService.isMango
SettingsToggleRow {
tab: "theme"
@@ -2334,7 +2335,7 @@ Item {
title: I18n.tr("Cursor Theme")
settingKey: "cursorTheme"
iconName: "mouse"
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango
Column {
width: parent.width
@@ -2490,6 +2491,8 @@ Item {
return SettingsData.cursorSettings.hyprland?.inactiveTimeout || 0;
if (CompositorService.isDwl)
return SettingsData.cursorSettings.dwl?.cursorHideTimeout || 0;
if (CompositorService.isMango)
return SettingsData.cursorSettings.mango?.cursorHideTimeout || 0;
return 0;
}
minimum: 0
@@ -2510,6 +2513,10 @@ Item {
if (!updated.dwl)
updated.dwl = {};
updated.dwl.cursorHideTimeout = newValue;
} else if (CompositorService.isMango) {
if (!updated.mango)
updated.mango = {};
updated.mango.cursorHideTimeout = newValue;
}
SettingsData.set("cursorSettings", updated);
}
+2 -2
View File
@@ -37,8 +37,8 @@ Item {
"text": I18n.tr("Layout"),
"description": I18n.tr("Display and switch DWL layouts"),
"icon": "view_quilt",
"enabled": CompositorService.isDwl && DwlService.dwlAvailable,
"warning": !CompositorService.isDwl ? I18n.tr("Requires DWL compositor") : (!DwlService.dwlAvailable ? I18n.tr("DWL service not available") : undefined)
"enabled": (CompositorService.isDwl && DwlService.dwlAvailable) || (CompositorService.isMango && MangoService.available),
"warning": CompositorService.isMango ? (!MangoService.available ? I18n.tr("DWL service not available") : undefined) : (!CompositorService.isDwl ? I18n.tr("Requires DWL compositor") : (!DwlService.dwlAvailable ? I18n.tr("DWL service not available") : undefined))
},
{
"id": "launcherButton",
+23 -9
View File
@@ -30,6 +30,7 @@ Item {
property var externalRules: []
property var activeWindows: getActiveWindows()
property string expandedExternalId: ""
readonly property string dmsRulesFileName: CompositorService.isNiri ? "dms/windowrules.kdl" : CompositorService.isMango ? "dms/windowrules.conf" : "dms/windowrules.lua"
readonly property var matchLabels: ({
"appId": I18n.tr("App ID"),
@@ -166,6 +167,13 @@ Item {
"grepPattern": "dms.windowrules",
"includeLine": "require(\"dms.windowrules\")"
};
case "mango":
return {
"configFile": configDir + "/mango/config.conf",
"rulesFile": configDir + "/mango/dms/windowrules.conf",
"grepPattern": "dms/windowrules.conf",
"includeLine": "source=./dms/windowrules.conf"
};
default:
return null;
}
@@ -173,7 +181,7 @@ Item {
function loadWindowRules() {
const compositor = CompositorService.compositor;
if (compositor !== "niri" && compositor !== "hyprland") {
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "mango") {
windowRules = [];
externalRules = [];
return;
@@ -211,11 +219,13 @@ Item {
return;
}
const compositor = CompositorService.compositor;
if (compositor !== "niri" && compositor !== "hyprland")
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "mango")
return;
Proc.runCommand("remove-windowrule", ["dms", "config", "windowrules", "remove", compositor, ruleId], (output, exitCode) => {
if (exitCode === 0) {
if (CompositorService.isMango)
MangoService.reloadConfig();
loadWindowRules();
rulesChanged();
}
@@ -231,7 +241,7 @@ Item {
return;
const compositor = CompositorService.compositor;
if (compositor !== "niri" && compositor !== "hyprland")
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "mango")
return;
let ids = windowRules.map(r => r.id);
@@ -240,6 +250,8 @@ Item {
Proc.runCommand("reorder-windowrules", ["dms", "config", "windowrules", "reorder", compositor, JSON.stringify(ids)], (output, exitCode) => {
if (exitCode === 0) {
if (CompositorService.isMango)
MangoService.reloadConfig();
loadWindowRules();
rulesChanged();
}
@@ -248,7 +260,7 @@ Item {
function checkWindowRulesIncludeStatus() {
const compositor = CompositorService.compositor;
if (compositor !== "niri" && compositor !== "hyprland") {
if (compositor !== "niri" && compositor !== "hyprland" && compositor !== "mango") {
windowRulesIncludeStatus = {
"exists": false,
"included": false,
@@ -258,7 +270,7 @@ Item {
return;
}
const filename = (compositor === "niri") ? "windowrules.kdl" : "windowrules.lua";
const filename = (compositor === "niri") ? "windowrules.kdl" : (compositor === "mango") ? "windowrules.conf" : "windowrules.lua";
checkingInclude = true;
Proc.runCommand("check-windowrules-include", ["dms", "config", "resolve-include", compositor, filename], (output, exitCode) => {
checkingInclude = false;
@@ -306,6 +318,8 @@ Item {
fixingInclude = false;
if (exitCode !== 0)
return;
if (CompositorService.isMango)
MangoService.reloadConfig();
checkWindowRulesIncludeStatus();
loadWindowRules();
});
@@ -358,7 +372,7 @@ Item {
}
Component.onCompleted: {
if (CompositorService.isNiri || CompositorService.isHyprland) {
if (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango) {
checkWindowRulesIncludeStatus();
loadWindowRules();
}
@@ -415,7 +429,7 @@ Item {
}
StyledText {
text: I18n.tr("Define rules for window behavior. Saves to %1").arg(CompositorService.isNiri ? "dms/windowrules.kdl" : "dms/windowrules.lua")
text: I18n.tr("Define rules for window behavior. Saves to %1").arg(root.dmsRulesFileName)
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
@@ -489,7 +503,7 @@ Item {
color: (showLegacy || showError || showSetup) ? Theme.withAlpha(Theme.warning, 0.15) : "transparent"
border.color: (showLegacy || showError || showSetup) ? Theme.withAlpha(Theme.warning, 0.3) : "transparent"
border.width: 1
visible: (showLegacy || showError || showSetup) && !root.checkingInclude && (CompositorService.isNiri || CompositorService.isHyprland)
visible: (showLegacy || showError || showSetup) && !root.checkingInclude && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango)
Row {
id: warningSection
@@ -519,7 +533,7 @@ Item {
}
StyledText {
readonly property string rulesFile: CompositorService.isNiri ? "dms/windowrules.kdl" : "dms/windowrules.lua"
readonly property string rulesFile: root.dmsRulesFileName
text: warningBox.showLegacy ? I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before editing window rules in Settings.") : (warningBox.showSetup ? I18n.tr("Click 'Setup' to create %1 and add include to your compositor config.").arg(rulesFile) : I18n.tr("%1 exists but is not included. Window rules won't apply.").arg(rulesFile))
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
@@ -59,7 +59,7 @@ Item {
text: I18n.tr("Show Workspace Apps")
description: I18n.tr("Display application icons in workspace indicators")
checked: SettingsData.showWorkspaceApps
visible: CompositorService.isNiri || CompositorService.isHyprland
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
onToggled: checked => SettingsData.set("showWorkspaceApps", checked)
}
@@ -151,7 +151,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 || CompositorService.isMiracle
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
onToggled: checked => SettingsData.set("workspaceFollowFocus", checked)
}
@@ -161,7 +161,7 @@ Item {
text: I18n.tr("Show Occupied Workspaces Only")
description: I18n.tr("Display only workspaces that contain windows")
checked: SettingsData.showOccupiedWorkspacesOnly
visible: CompositorService.isNiri || CompositorService.isHyprland
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
onToggled: checked => SettingsData.set("showOccupiedWorkspacesOnly", checked)
}
@@ -171,7 +171,7 @@ Item {
text: I18n.tr("Reverse Scrolling Direction")
description: I18n.tr("Reverse workspace switch direction when scrolling over the bar")
checked: SettingsData.reverseScrolling
visible: CompositorService.isNiri || CompositorService.isHyprland
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
onToggled: checked => SettingsData.set("reverseScrolling", checked)
}
@@ -191,7 +191,7 @@ Item {
text: I18n.tr("Show All Tags")
description: I18n.tr("Show all 9 tags instead of only occupied tags (DWL only)")
checked: SettingsData.dwlShowAllTags
visible: CompositorService.isDwl
visible: CompositorService.isDwl || CompositorService.isMango
onToggled: checked => SettingsData.set("dwlShowAllTags", checked)
}
}
@@ -243,7 +243,7 @@ Item {
SettingsButtonGroupRow {
text: I18n.tr("Occupied Color")
model: ["none", "sec", "s", "sc", "sch", "schh"]
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango
buttonHeight: 22
minButtonWidth: 36
buttonPadding: Theme.spacingS
@@ -279,7 +279,7 @@ Item {
height: 1
color: Theme.outline
opacity: 0.15
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango
}
SettingsButtonGroupRow {
@@ -316,12 +316,12 @@ Item {
height: 1
color: Theme.outline
opacity: 0.15
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
}
SettingsButtonGroupRow {
text: I18n.tr("Urgent Color")
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isDwl || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
model: ["err", "pri", "sec", "s", "sc"]
buttonHeight: 22
minButtonWidth: 36