mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 21:48:30 -04:00
freebsd: add initial support for running on FreeBSD, excluding Bluez,
ppd, and some things. Add a simple wpa_supplicant backend
This commit is contained in:
@@ -12,6 +12,8 @@ Singleton {
|
||||
id: root
|
||||
readonly property var log: Log.scoped("SessionService")
|
||||
|
||||
// Qt.platform.os is "unix" on the BSDs (qtdeclarative qqmlplatform.cpp)
|
||||
readonly property bool isBSD: Qt.platform.os === "unix"
|
||||
property bool hasUwsm: false
|
||||
property bool isElogind: false
|
||||
property bool loginctlCommandAvailable: false
|
||||
@@ -351,10 +353,26 @@ Singleton {
|
||||
}
|
||||
|
||||
function powerManagerCommand(action) {
|
||||
if (isBSD)
|
||||
return bsdPowerCommand(action);
|
||||
const useLoginctl = isElogind || (loginctlCommandAvailable && !systemctlCommandAvailable);
|
||||
return [useLoginctl ? "loginctl" : "systemctl", action];
|
||||
}
|
||||
|
||||
function bsdPowerCommand(action) {
|
||||
switch (action) {
|
||||
case "suspend":
|
||||
case "suspend-then-hibernate":
|
||||
return ["acpiconf", "-s", "3"];
|
||||
case "hibernate":
|
||||
return ["acpiconf", "-s", "4"];
|
||||
case "reboot":
|
||||
return ["shutdown", "-r", "now"];
|
||||
default:
|
||||
return ["shutdown", "-p", "now"];
|
||||
}
|
||||
}
|
||||
|
||||
function suspend() {
|
||||
if (SettingsData.customPowerActionSuspend.length === 0) {
|
||||
Quickshell.execDetached(powerManagerCommand("suspend"));
|
||||
|
||||
Reference in New Issue
Block a user