1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

power: disable profile osd by default, ensure dbus activation doesnt

happen
This commit is contained in:
bbedward
2025-11-23 18:17:04 -05:00
parent 23538c0323
commit 43bea80cad
11 changed files with 207 additions and 204 deletions

View 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;
}
}
}