mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2026-09-19 10:19:02 +05:30
feat(power): add power profile component
This commit is contained in:
22
services/PowerProfile.qml
Normal file
22
services/PowerProfile.qml
Normal 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`
|
||||
}
|
||||
Reference in New Issue
Block a user