mirror of
https://github.com/tuxdotrs/tshell.git
synced 2026-09-19 10:39:04 +05:30
14 lines
510 B
QML
14 lines
510 B
QML
pragma Singleton
|
|
|
|
import Quickshell
|
|
import QtQuick
|
|
import Quickshell.Services.UPower
|
|
|
|
Singleton {
|
|
id: root
|
|
readonly property int percentage: Math.round(UPower.displayDevice.percentage * 100)
|
|
readonly property real energyRate: UPower.displayDevice.changeRate
|
|
readonly property string iconName: root.percentage < 30 ? "battery-low.svg" : root.percentage < 70 ? "battery-medium.svg" : "battery-full.svg"
|
|
readonly property url icon: `${Quickshell.shellPath("assets")}/icons/${root.iconName}`
|
|
}
|