feat(power): add power profile component

This commit is contained in:
tux
2026-08-23 17:45:45 +05:30
parent 1ded80d1c0
commit 3b01362a5a
4 changed files with 35 additions and 0 deletions

22
services/PowerProfile.qml Normal file
View File

@@ -0,0 +1,22 @@
pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Services.UPower as UPower
Singleton {
id: root
readonly property bool performanceAvailable: UPower.PowerProfiles.hasPerformanceProfile
readonly property string name: {
switch (UPower.PowerProfiles.profile) {
case UPower.PowerProfile.Performance:
return "Performance";
case UPower.PowerProfile.PowerSaver:
return "Power Saver";
default:
return "Balanced";
}
}
readonly property url icon: `${Quickshell.shellPath("assets")}/icons/power.svg`
}