added battery thing but it doesnt work
This commit is contained in:
23
Services/BatteryManager.qml
Normal file
23
Services/BatteryManager.qml
Normal file
@@ -0,0 +1,23 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.UPower
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property UPowerDevice battery: Upower.displayDevice
|
||||
property bool batteryInUse: root.batteryPresent && root.batteryLaptop
|
||||
property bool batteryLaptop: root.battery.isLaptopBattery
|
||||
property double batteryPercentage: root.battery.percentage
|
||||
property bool batteryPresent: root.battery.ready
|
||||
|
||||
function getBatteryIcon() {
|
||||
let battery = root.battery;
|
||||
if (battery.state = UpowerDeviceState.Charging) {
|
||||
return "";
|
||||
}
|
||||
if (battery.state = UpowerDeviceState.Discharging) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,3 +4,4 @@ singleton NotificationManager 1.0 NotificationManager.qml
|
||||
singleton WorkspaceManager 1.0 WorkspaceManager.qml
|
||||
singleton BluetoothManager 1.0 BluetoothManager.qml
|
||||
singleton MprisManager 1.0 MprisManager.qml
|
||||
singleton BatteryManager 1.0 BatteryManager.qml
|
||||
|
||||
Reference in New Issue
Block a user