spacr.qt.laptop_mode¶
Measure hardware constraints and suppress the ambient backdrop for this process.
Hardware-based decisions use the usable CPU count, physical memory and the
SPACR_LAPTOP_MODE override. GUI startup instead passes an explicit decision
from the selected performance level; its hardware reading is diagnostic.
Suppression affects backdrop rendering. This module does not set worker-thread limits or analysis parameters, and it does not replace stored animation preferences.
apply sets SPACR_NO_BACKDROP when suppression is requested and the
ambient backdrop is enabled. Disabling removes only a suppression created by
this module; a pre-existing crash-recovery override is retained.
Functions¶
|
Apply process-local backdrop suppression and report the decision and actions. |
|
Format the hardware-based decision and effect descriptions for diagnostic logs. |
|
Return CPU count, physical memory, threshold flags and the parsed override. |
|
Parse the environment override; return |
|
Physical memory in GiB, or None when it cannot be read. |
|
Return the CPU affinity count, falling back to |
|
Return the hardware-based laptop-mode decision and its explanation. |
|
Return the animation and backdrop-blur descriptions used in diagnostics. |
Module Contents¶
- spacr.qt.laptop_mode.apply(on: bool | None = None) Dict[str, object][source]¶
Apply process-local backdrop suppression and report the decision and actions.
- Parameters:
on – explicit decision;
Noneuseswanted(), including its hardware reading and environment override.- Returns:
a mapping with
on,whyandchanged.onis the decision;changedlists actions actually performed and may be empty.
Suppression is process-local and does not replace the stored animation preference. Disabling clears only suppression created by this module, retaining any pre-existing crash-recovery override.
- spacr.qt.laptop_mode.describe() str[source]¶
Format the hardware-based decision and effect descriptions for diagnostic logs.
- spacr.qt.laptop_mode.measure() Dict[str, object][source]¶
Return CPU count, physical memory, threshold flags and the parsed override.
- spacr.qt.laptop_mode.override() bool | None[source]¶
Parse the environment override; return
Noneif absent or unrecognized.
- spacr.qt.laptop_mode.total_memory_gib() float | None[source]¶
Physical memory in GiB, or None when it cannot be read.
- spacr.qt.laptop_mode.usable_cores() int[source]¶
Return the CPU affinity count, falling back to
os.cpu_count.os.sched_getaffinityaccounts for process pinning when available. If it is unavailable or fails, use the reported CPU count instead. The result is at least one; the fallback does not measure affinity limits.
- spacr.qt.laptop_mode.wanted(reading: Dict[str, object] | None = None) Tuple[bool, str][source]¶
Return the hardware-based laptop-mode decision and its explanation.
- Returns:
(on, why). The reason is always populated, including when the decision is off. An explicit environment override takes precedence over the core-count and physical-memory threshold flags.
- spacr.qt.laptop_mode.what_it_turns_down() Tuple[Tuple[str, str], ...][source]¶
Return the animation and backdrop-blur descriptions used in diagnostics.
Each pair contains an effect name and its description for UI notes and logs. This function returns text;
apply()performs the process-local backdrop suppression.