diff --git a/features/scripts/utils/nomarchy-installed-summary b/features/scripts/utils/nomarchy-installed-summary index 0363912..aad28e0 100755 --- a/features/scripts/utils/nomarchy-installed-summary +++ b/features/scripts/utils/nomarchy-installed-summary @@ -26,9 +26,14 @@ tz=$(jq_or_empty "$SYS_STATE" '.timezone') dns=$(jq_or_empty "$SYS_STATE" '.dns') hybrid_gpu=$(jq_or_empty "$SYS_STATE" '.features.hybridGPU') -# Form factor: same battery-presence check the installer uses to auto-set -# nomarchy.{system.,}formFactor. -if compgen -G "/sys/class/power_supply/BAT*" >/dev/null; then +# Form factor: battery presence (same signal the installer uses to auto-set +# nomarchy.{system.,}formFactor). `compgen` is a bash programmable-completion +# builtin, and the non-interactive bash this script gets wrapped with is +# compiled without it — so a glob into a nullglob array, not `compgen -G`. +shopt -s nullglob +batteries=( /sys/class/power_supply/BAT* ) +shopt -u nullglob +if (( ${#batteries[@]} )); then form_factor="laptop" else form_factor="desktop"