From 2c6ae8a4287ffad33a8c41b08ef47b62494a67dd Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Wed, 14 Jan 2026 14:47:59 -0500 Subject: Add quickshell config --- .config/quickshell/Battery.qml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .config/quickshell/Battery.qml (limited to '.config/quickshell/Battery.qml') diff --git a/.config/quickshell/Battery.qml b/.config/quickshell/Battery.qml new file mode 100644 index 0000000..0d6213c --- /dev/null +++ b/.config/quickshell/Battery.qml @@ -0,0 +1,33 @@ +pragma Singleton + +import Quickshell +import Quickshell.Io +import QtQuick + +Singleton { + id: root + property string status: "Discharging" + property int capacity: 0 + + FileView { + id: statusFile + path: "/sys/class/power_supply/BAT0/status" + onLoaded: root.status = this.text().trim() + } + + FileView { + id: capacityFile + path: "/sys/class/power_supply/BAT0/capacity" + onLoaded: root.capacity = parseInt(this.text().trim()) + } + + Timer { + interval: 10000 + running: true + repeat: true + onTriggered: { + statusFile.reload() + capacityFile.reload() + } + } +} -- cgit v1.2.3