mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
power: disable profile osd by default, ensure dbus activation doesnt
happen
This commit is contained in:
@@ -11,10 +11,6 @@ Singleton {
|
||||
|
||||
property bool suppressSound: true
|
||||
property bool previousPluggedState: false
|
||||
property int currentPowerProfile: -1
|
||||
property int previousPowerProfile: -1
|
||||
|
||||
signal powerProfileChanged
|
||||
|
||||
Timer {
|
||||
id: startupTimer
|
||||
@@ -24,27 +20,6 @@ Singleton {
|
||||
onTriggered: root.suppressSound = false
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: typeof PowerProfiles !== "undefined" ? PowerProfiles : null
|
||||
|
||||
function onProfileChanged() {
|
||||
if (typeof PowerProfiles !== "undefined") {
|
||||
root.previousPowerProfile = root.currentPowerProfile;
|
||||
root.currentPowerProfile = PowerProfiles.profile;
|
||||
if (root.previousPowerProfile !== -1) {
|
||||
root.powerProfileChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (typeof PowerProfiles !== "undefined") {
|
||||
root.currentPowerProfile = PowerProfiles.profile;
|
||||
root.previousPowerProfile = PowerProfiles.profile;
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string preferredBatteryOverride: Quickshell.env("DMS_PREFERRED_BATTERY")
|
||||
|
||||
// List of laptop batteries
|
||||
@@ -160,7 +135,7 @@ Singleton {
|
||||
return isCharging ? "Charging" : (isPluggedIn ? "Plugged In" : "Discharging");
|
||||
}
|
||||
|
||||
readonly property bool suggestPowerSaver: batteryAvailable && isLowBattery && UPower.onBattery && (typeof PowerProfiles !== "undefined" && PowerProfiles.profile !== PowerProfile.PowerSaver)
|
||||
readonly property bool suggestPowerSaver: false
|
||||
|
||||
readonly property var bluetoothDevices: {
|
||||
const btDevices = [];
|
||||
|
||||
36
quickshell/Services/PowerProfileWatcher.qml
Normal file
36
quickshell/Services/PowerProfileWatcher.qml
Normal file
@@ -0,0 +1,36 @@
|
||||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.UPower
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property int currentProfile: -1
|
||||
property int previousProfile: -1
|
||||
|
||||
signal profileChanged(int profile)
|
||||
|
||||
Connections {
|
||||
target: typeof PowerProfiles !== "undefined" ? PowerProfiles : null
|
||||
|
||||
function onProfileChanged() {
|
||||
if (typeof PowerProfiles !== "undefined") {
|
||||
root.previousProfile = root.currentProfile;
|
||||
root.currentProfile = PowerProfiles.profile;
|
||||
if (root.previousProfile !== -1) {
|
||||
root.profileChanged(root.currentProfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (typeof PowerProfiles !== "undefined") {
|
||||
root.currentProfile = PowerProfiles.profile;
|
||||
root.previousProfile = PowerProfiles.profile;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user