Removed useless subdirectory, changed to dolphin
This commit is contained in:
parent
2e2d683c62
commit
f20db908ca
10 changed files with 4 additions and 4 deletions
43
quickshell/modules/Battery.qml
Normal file
43
quickshell/modules/Battery.qml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import Quickshell.Services.UPower
|
||||
import QtQuick
|
||||
import qs
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
clip: true
|
||||
color: Appearance.colAppBg
|
||||
visible: UPower.displayDevice.isPresent
|
||||
property var batCharMin: (UPower.displayDevice.timeToFull / 60).toFixed(2)
|
||||
property var batDisMin: (UPower.displayDevice.timeToEmpty / 60).toFixed(2)
|
||||
property var batTime: 0
|
||||
implicitHeight: Appearance.appletRadHeight
|
||||
implicitWidth: batText.implicitWidth + 25
|
||||
radius: Appearance.appletRadHeight
|
||||
|
||||
function getBatStat() {
|
||||
if (UPower.displayDevice.state == UPowerDeviceState.Discharging) {
|
||||
batTime = Math.floor(batDisMin / 60) + "h " + ((batDisMin - (Math.floor(batDisMin / 60) * 60)).toFixed(0)) + "min"
|
||||
return batTime;
|
||||
}
|
||||
if (UPower.displayDevice.state == UPowerDeviceState.Charging) {
|
||||
batTime = Math.floor(batCharMin / 60) + "h " + ((batCharMin - (Math.floor(batCharMin / 60) * 60)).toFixed(0)) + "min"
|
||||
return batTime;
|
||||
}
|
||||
if (UPower.displayDevice.state == UPowerDeviceState.FullyCharged) {
|
||||
return "Full";
|
||||
}
|
||||
}
|
||||
function batStatProc() {
|
||||
return Math.round(UPower.displayDevice.percentage * 100) + "%";
|
||||
}
|
||||
|
||||
Text {
|
||||
id: batText
|
||||
anchors.centerIn: parent
|
||||
text: batStatProc() + " - " + getBatStat()
|
||||
font.family: Appearance.font
|
||||
font.pixelSize: Appearance.fontSize
|
||||
font.bold: true
|
||||
color: Appearance.colFg
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue