Notice the battery, and the machine it is or is not in
Panama had no idea whether it was running on a laptop. No upower, no battery, no lid, no AC: hypridle.conf says "This is a desktop" in its own header, and that was true of the code as well as the machine. panama-hw answers hardware questions one at a time, exits 0 or 1, and prints nothing, so scripts, services and contracts all ask the same way. The definition the rest of the laptop work hangs on is one line: clamshell is lid-closed AND an external monitor. A machine with no mains supply at all reports as being on wall power, because a desktop cannot run out of it. The battery service follows Vitals: sysfs through FileView, an availability flag, and no subprocess on the timer. Globbing is the one thing QML cannot do -- a battery is BAT0 or BAT1 or CMB0, mains is AC or ADP1 or ACAD -- so panama-battery resolves the names once and the shell reads the files directly after. Nothing falls back to a plausible zero: a desktop shows no indicator, no card, and no charge limit control where the firmware has no ceiling. Also repairs two contracts that were already failing and had not been noticed, because only the full suite runs them. The dependency scanner treated line-initial variable assignments, case labels, comments and heredoc bodies as commands, and `count`, `host`, `cancel` and `import` are all real binaries on Fedora, so `command -v` could not filter them out. It now drops comments and heredoc bodies and requires a command to be followed by whitespace. Verified it still catches a genuinely undeclared dependency rather than passing quietly. The launcher command contract had not been told about the fourteen commands added earlier today.
This commit is contained in:
@@ -84,6 +84,39 @@ Singleton {
|
||||
label: "Graphics",
|
||||
detail: "Show graphics usage beside the workspace indicator"
|
||||
},
|
||||
// Only ever visible on a machine that has a battery: the indicator
|
||||
// gates on Battery.available as well as this, the way the graphics
|
||||
// field gates on Vitals.gpuAvailable.
|
||||
{
|
||||
key: "showBattery", type: "bool", def: true, group: "vitals",
|
||||
label: "Battery",
|
||||
detail: "Show the charge level in the bar, on machines that have a battery"
|
||||
},
|
||||
|
||||
// ── Battery ─────────────────────────────────────────────────────────
|
||||
// The two points at which the desktop starts telling you. Low is a
|
||||
// quiet mention; critical is the one that interrupts, so it is
|
||||
// published at a priority Do Not Disturb does not silence.
|
||||
{
|
||||
key: "batteryLowPercent", type: "int", def: 20, min: 5, max: 50, step: 5,
|
||||
unit: "%", group: "battery",
|
||||
label: "Warn at",
|
||||
detail: "Mention the battery once it drops this low"
|
||||
},
|
||||
{
|
||||
key: "batteryCriticalPercent", type: "int", def: 5, min: 1, max: 25, step: 1,
|
||||
unit: "%", group: "battery",
|
||||
label: "Urgent at",
|
||||
detail: "Interrupt at this level, even during Do Not Disturb"
|
||||
},
|
||||
// Only offered where the firmware exposes a ceiling; the Power page
|
||||
// hides the control entirely otherwise. 100 means charge to full.
|
||||
{
|
||||
key: "batteryChargeLimit", type: "int", def: 100, min: 50, max: 100, step: 5,
|
||||
unit: "%", group: "battery",
|
||||
label: "Stop charging at",
|
||||
detail: "Charging to less than full is easier on the battery over years"
|
||||
},
|
||||
|
||||
// ── Dock ────────────────────────────────────────────────────────────
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user