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:
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