mirror of
https://github.com/tuxdotrs/tshell.git
synced 2026-09-19 18:49:02 +05:30
refactor(structure): move components to folders
This commit is contained in:
13
services/Battery.qml
Normal file
13
services/Battery.qml
Normal file
@@ -0,0 +1,13 @@
|
||||
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}`
|
||||
}
|
||||
Reference in New Issue
Block a user