Battery widget #7

Merged
Zacharias-Brohn merged 8 commits from battery-widget into main 2026-02-11 16:49:52 +01:00
6 changed files with 58 additions and 13 deletions
Showing only changes of commit 8c2a2dac34 - Show all commits
-13
View File
@@ -1,13 +0,0 @@
import QtQuick
import qs.Config
import qs.Modules
import qs.Components
CustomText {
text: Time.time
color: Config.useDynamicColors ? DynamicColors.palette.m3tertiary : "white"
Behavior on color {
CAnim {}
}
}
+4
View File
@@ -36,6 +36,10 @@ JsonObject {
id: "tray",
enabled: true
},
{
id: "upower",
enabled: false
},
{
id: "clock",
enabled: true
+13
View File
@@ -0,0 +1,13 @@
pragma Singleton
import Quickshell
import Quickshell.Services.UPower
Singleton {
id: root
readonly property list<UPowerDevice> devices: UPower.devices.values
readonly property bool onBattery: UPower.onBattery
readonly property UPowerDevice displayDevice: UPower.displayDevice
}
+7
View File
@@ -9,6 +9,7 @@ import qs.Config
import qs.Helpers
import qs.Daemons
import qs.Modules.Polkit
import qs.Modules.UPower
RowLayout {
id: root
@@ -160,6 +161,12 @@ RowLayout {
}
}
}
DelegateChoice {
roleValue: "upower"
delegate: WrappedLoader {
sourceComponent: UPowerWidget {}
}
}
}
}
+26
View File
@@ -0,0 +1,26 @@
import Quickshell
import QtQuick
import qs.Components
import qs.Config
import qs.Helpers
import qs.Modules
Item {
id: root
implicitWidth: 100
anchors.top: parent.top
anchors.bottom: parent.bottom
function findDevice() {
for ( let i = 0; i < UPower.devices.count; i++ ) {
if ( UPower.devices[i].isLaptopBattery ) {
return UPower.devices[i];
}
}
}
CustomText {
text: findDevice().percentage
}
}
+8
View File
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
main() {
if [[ ]]
}
main "$@"