mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
Initial commit
This commit is contained in:
commit
05cd51b54e
148 changed files with 10112 additions and 0 deletions
38
.stversions/bar/BatteryIndicator~20250307-175400.qml
Normal file
38
.stversions/bar/BatteryIndicator~20250307-175400.qml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Services.UPower
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
property string batteryStatus: {
|
||||
if (!UPower.onBattery) {
|
||||
return "charging";
|
||||
}
|
||||
|
||||
let percentage = UPower.displayDevice.percentage * 100;
|
||||
let roundedValue = Math.floor(percentage / 5) * 5;
|
||||
return roundedValue.toString();
|
||||
}
|
||||
|
||||
width: 30;
|
||||
height: parent.height;
|
||||
visible: UPower.displayDevice.isLaptopBattery;
|
||||
|
||||
Rectangle {
|
||||
color: ShellGlobals.colors.highlight;
|
||||
width: 12;
|
||||
height: 8;
|
||||
visible: batteryStatus === "charging";
|
||||
|
||||
anchors {
|
||||
centerIn: batteryImage;
|
||||
}
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: batteryImage;
|
||||
implicitSize: 20;
|
||||
source: Qt.resolvedUrl(`../resources/battery/battery-${batteryStatus}.svg`);
|
||||
anchors.centerIn: parent;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue