mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
cursor: hypr, mango, and dankinstall support for configs
This commit is contained in:
@@ -14,6 +14,7 @@ Singleton {
|
||||
readonly property string mangoDmsDir: configDir + "/mango/dms"
|
||||
readonly property string outputsPath: mangoDmsDir + "/outputs.conf"
|
||||
readonly property string layoutPath: mangoDmsDir + "/layout.conf"
|
||||
readonly property string cursorPath: mangoDmsDir + "/cursor.conf"
|
||||
|
||||
property int _lastGapValue: -1
|
||||
|
||||
@@ -400,4 +401,53 @@ borderpx=${borderSize}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function generateCursorConfig() {
|
||||
if (!CompositorService.isDwl)
|
||||
return;
|
||||
|
||||
console.log("DwlService: Generating cursor config...");
|
||||
|
||||
const settings = typeof SettingsData !== "undefined" ? SettingsData.cursorSettings : null;
|
||||
if (!settings) {
|
||||
Proc.runCommand("mango-write-cursor", ["sh", "-c", `mkdir -p "${mangoDmsDir}" && : > "${cursorPath}"`], (output, exitCode) => {
|
||||
if (exitCode !== 0)
|
||||
console.warn("DwlService: Failed to write cursor config:", output);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const themeName = settings.theme === "System Default" ? (SettingsData.systemDefaultCursorTheme || "") : settings.theme;
|
||||
const size = settings.size || 24;
|
||||
const hideTimeout = settings.dwl?.cursorHideTimeout || 0;
|
||||
|
||||
const isDefaultConfig = !themeName && size === 24 && hideTimeout === 0;
|
||||
if (isDefaultConfig) {
|
||||
Proc.runCommand("mango-write-cursor", ["sh", "-c", `mkdir -p "${mangoDmsDir}" && : > "${cursorPath}"`], (output, exitCode) => {
|
||||
if (exitCode !== 0)
|
||||
console.warn("DwlService: Failed to write cursor config:", output);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
let content = `# Auto-generated by DMS - do not edit manually
|
||||
cursor_size=${size}`;
|
||||
|
||||
if (themeName)
|
||||
content += `\ncursor_theme=${themeName}`;
|
||||
|
||||
if (hideTimeout > 0)
|
||||
content += `\ncursor_hide_timeout=${hideTimeout}`;
|
||||
|
||||
content += `\n`;
|
||||
|
||||
Proc.runCommand("mango-write-cursor", ["sh", "-c", `mkdir -p "${mangoDmsDir}" && cat > "${cursorPath}" << 'EOF'\n${content}EOF`], (output, exitCode) => {
|
||||
if (exitCode !== 0) {
|
||||
console.warn("DwlService: Failed to write cursor config:", output);
|
||||
return;
|
||||
}
|
||||
console.info("DwlService: Generated cursor config at", cursorPath);
|
||||
reloadConfig();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user