//TODO let's start by simplifying the output, then see about simpifying the //input import "../.." import QtQuick import QtQuick.Layouts import Quickshell.Services.UPower import "classes" RowLayout { layoutDirection: Qt.RightToLeft Repeater { model: UPower.devices.values.filter(d => d.model) RowLayout { spacing: 2 layoutDirection: Qt.RightToLeft property var lvl: Math.round(modelData.percentage * 100) property var charge_state: UPowerDeviceState.toString(modelData.state) property var device_type: UPowerDeviceType.toString(modelData.type) BarText { text: lvl + "%" color: (charge_state == "Charging") ? Style.saffron : (lvl < 20) ? Style.scarlet : Style.fg } BarText { text: modelData.model == "Jupiter of the Monkey" ? Icons.jotm : Icons.devices[modelData.type] color: (charge_state == "Charging") ? Style.saffron : (lvl < 20) ? Style.scarlet : Style.orange } BarText { text: Resources.sep } } } }