diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-12 18:24:09 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-12 18:24:09 +1000 |
| commit | 2d878def2803d8ab26ad1ac3cfb6448c2fb8d95e (patch) | |
| tree | e83745a0a080afcf598ec9ab4e86302d6cde27c1 /modules/lock | |
| parent | config: add clock font config (diff) | |
| download | caelestia-shell-2d878def2803d8ab26ad1ac3cfb6448c2fb8d95e.tar.gz caelestia-shell-2d878def2803d8ab26ad1ac3cfb6448c2fb8d95e.tar.bz2 caelestia-shell-2d878def2803d8ab26ad1ac3cfb6448c2fb8d95e.zip | |
lock/fetch: add battery
Diffstat (limited to 'modules/lock')
| -rw-r--r-- | modules/lock/Fetch.qml | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/modules/lock/Fetch.qml b/modules/lock/Fetch.qml index d33ebf1..eed8987 100644 --- a/modules/lock/Fetch.qml +++ b/modules/lock/Fetch.qml @@ -6,6 +6,7 @@ import qs.config import qs.utils import Quickshell import Quickshell.Widgets +import Quickshell.Services.UPower import QtQuick import QtQuick.Layouts @@ -90,7 +91,7 @@ ColumnLayout { Loader { Layout.fillWidth: true asynchronous: true - active: root.height > 200 + active: !batLoader.active && root.height > 200 visible: active sourceComponent: FetchText { @@ -101,7 +102,7 @@ ColumnLayout { Loader { Layout.fillWidth: true asynchronous: true - active: root.height > 110 + active: root.height > (batLoader.active ? 200 : 110) visible: active sourceComponent: FetchText { @@ -116,6 +117,19 @@ ColumnLayout { FetchText { text: `UP : ${SysInfo.uptime}` } + + Loader { + id: batLoader + + Layout.fillWidth: true + asynchronous: true + active: UPower.displayDevice.isLaptopBattery + visible: active + + sourceComponent: FetchText { + text: `BATT: ${UPower.onBattery ? "" : "(+) "}${Math.round(UPower.displayDevice.percentage * 100)}%` + } + } } } |