initial commit

This commit is contained in:
Damocles 2026-04-10 10:49:48 +02:00
commit 9fde6d4fc6
27 changed files with 1110 additions and 0 deletions

32
modules/Battery.qml Normal file
View file

@ -0,0 +1,32 @@
import QtQuick
import Quickshell.Services.UPower
import "." as M
Row {
id: root
spacing: 4
visible: UPower.displayDevice?.isLaptopBattery ?? false
readonly property var dev: UPower.displayDevice
readonly property real pct: (dev?.percentage ?? 0) * 100
readonly property bool charging: dev?.state === UPowerDeviceState.Charging
Text {
text: {
if (root.charging) return "";
const icons = ["󰂎","󰁺","󰁻","󰁼","󰁽","󰁾","󰁿","󰂀","󰂁","󰂂","󱟢"];
return icons[Math.min(10, Math.floor(root.pct / 10))];
}
color: root.pct < 15 ? M.Theme.base08 : M.Theme.base05
font.pixelSize: M.Theme.fontSize + 2
font.family: M.Theme.fontFamily
anchors.verticalCenter: parent.verticalCenter
}
Text {
text: Math.round(root.pct) + "%"
color: root.pct < 15 ? M.Theme.base08 : M.Theme.base05
font.pixelSize: M.Theme.fontSize
font.family: M.Theme.fontFamily
anchors.verticalCenter: parent.verticalCenter
}
}