mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 23:42:51 -05:00
@@ -103,6 +103,27 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: hibernateProcess
|
||||||
|
running: false
|
||||||
|
|
||||||
|
property string errorOutput: ""
|
||||||
|
|
||||||
|
stderr: SplitParser {
|
||||||
|
splitMarker: "\n"
|
||||||
|
onRead: data => hibernateProcess.errorOutput += data.trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
onExited: function (exitCode) {
|
||||||
|
if (exitCode === 0) {
|
||||||
|
errorOutput = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ToastService.showError("Hibernate failed", errorOutput);
|
||||||
|
errorOutput = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: detectPrimeRunProcess
|
id: detectPrimeRunProcess
|
||||||
running: false
|
running: false
|
||||||
@@ -274,11 +295,13 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function hibernate() {
|
function hibernate() {
|
||||||
if (SettingsData.customPowerActionHibernate.length === 0) {
|
hibernateProcess.errorOutput = "";
|
||||||
Quickshell.execDetached([isElogind ? "loginctl" : "systemctl", "hibernate"]);
|
if (SettingsData.customPowerActionHibernate.length > 0) {
|
||||||
|
hibernateProcess.command = ["sh", "-c", SettingsData.customPowerActionHibernate];
|
||||||
} else {
|
} else {
|
||||||
Quickshell.execDetached(["sh", "-c", SettingsData.customPowerActionHibernate]);
|
hibernateProcess.command = [isElogind ? "loginctl" : "systemctl", "hibernate"];
|
||||||
}
|
}
|
||||||
|
hibernateProcess.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function suspendThenHibernate() {
|
function suspendThenHibernate() {
|
||||||
|
|||||||
Reference in New Issue
Block a user