Let the laptop say what it is doing: battery percentage, the lid, a fingerprint
Three surfaces the first laptop install showed were missing. The bar's battery icon gets an optional exact number beside it -- GNOME's "Show Battery Percentage", off by default for GNOME's reason, one color with the icon so it reads as one indicator. The Power page says what closing the lid does. The policy already existed (LidPolicy holds a suspend inhibitor while an external display is connected) but was surfaced nowhere, so the machine's most physical behavior was undiscoverable -- and the deliberate absence of an override deserves stating rather than leaving someone to hunt for a switch that does not exist. And the Users page grows a Fingerprint card, because fingerprint login is two systems that fail silently when they disagree: fprintd holds the enrolled prints, authselect decides whether PAM ever asks the reader. This machine arrived with a finger enrolled from its GNOME days and with-fingerprint off, which reads as "the reader is broken". The card shows both facts, flips the authselect feature through polkit with a stated reason, and hands enrollment to GNOME's Users panel, which owns the only good capture dialog -- a named exception in the handoff contract. Everything through scripts/panama-fingerprint, pinned by a stub-driven contract. Claude-Session: https://claude.ai/code/session_01Epx9ZC1gwm81K3jm9x9CKh
This commit is contained in:
@@ -130,6 +130,16 @@ Pill {
|
||||
// battery has actually been read, so this is not a zero that looks like a
|
||||
// flat cell. Same shape as the graphics field in VitalsWidget, which gates
|
||||
// on both the preference and the hardware.
|
||||
//
|
||||
// One color for the icon and the number beside it: two different colors
|
||||
// would read as two indicators.
|
||||
readonly property color batteryColor: {
|
||||
if (Battery.critical) return Theme.danger;
|
||||
if (Battery.low) return Theme.warn;
|
||||
if (Battery.charging) return Theme.ok;
|
||||
return Theme.fg;
|
||||
}
|
||||
|
||||
StatusGlyph {
|
||||
visible: Settings.showBattery && Battery.available
|
||||
glyph: {
|
||||
@@ -141,11 +151,24 @@ Pill {
|
||||
// md-battery_10 .. md-battery_90 are consecutive from F007A.
|
||||
return String.fromCodePoint(0xF007A + (level / 10) - 1);
|
||||
}
|
||||
color: {
|
||||
if (Battery.critical) return Theme.danger;
|
||||
if (Battery.low) return Theme.warn;
|
||||
if (Battery.charging) return Theme.ok;
|
||||
return Theme.fg;
|
||||
color: root.batteryColor
|
||||
}
|
||||
|
||||
// The exact number, for the people who ask the icon to be more specific --
|
||||
// GNOME's "Show Battery Percentage", living under the same gates as the
|
||||
// icon it annotates.
|
||||
Text {
|
||||
visible: Settings.showBattery && Settings.showBatteryPercent && Battery.available
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: Math.round(Battery.percent) + "%"
|
||||
color: root.batteryColor
|
||||
font.family: Theme.fontFamily
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Theme.durFast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user