mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 01:32:29 -04:00
miraclewm: add support for Miracle WM
This commit is contained in:
@@ -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 (_) {}
|
||||
|
||||
Reference in New Issue
Block a user