Add initial voice-command support

Adds a single wakeword-style voice command, "screen on", and deals with
all the wiring and permissions that entails. Currently this only
supports using the phone's mic (or a bluetooth headset), not the G2 mic.
This commit is contained in:
James Babcock committed 2026-04-27 16:45:09 -07:00
1 parent c4cb4f9f01
commit 9fbb985db6
35 files changed
+1722 -16

No files matched your search

+11
View File
@@ -21,9 +21,11 @@ export type WakeModeSetting = "tiled" | "synchronized";
export const DEFAULT_SYSTEM_CARD_NAME = "Faceclaw";
export const DEFAULT_SCREEN_TIMEOUT: ScreenTimeoutSetting = "30s";
export const DEFAULT_WAKE_MODE: WakeModeSetting = "tiled";
export const DEFAULT_VOICE_CONTROL_ENABLED = false;
const SYSTEM_CARD_NAME_KEY = "dashboard.systemCardName";
const SCREEN_TIMEOUT_KEY = "display.screenTimeout";
const WAKE_MODE_KEY = "display.wakeMode";
const VOICE_CONTROL_ENABLED_KEY = "voice.enabled";
const SYSTEM_CARD_SETTING_KEYS: Record<SystemCardSettingKey, string> = {
showFaceclawLogo: "dashboard.systemCard.showFaceclawLogo",
showBatteryIndicators: "dashboard.systemCard.showBatteryIndicators",
@@ -138,6 +140,15 @@ export function saveWakeModeSetting(value: WakeModeSetting): WakeModeSetting {
return normalized;
}
export function loadVoiceControlEnabled(): boolean {
return ApplicationSettings.getBoolean(VOICE_CONTROL_ENABLED_KEY, DEFAULT_VOICE_CONTROL_ENABLED);
}
export function saveVoiceControlEnabled(value: boolean): boolean {
ApplicationSettings.setBoolean(VOICE_CONTROL_ENABLED_KEY, value);
return value;
}
export function nextScreenTimeoutSetting(value: ScreenTimeoutSetting): ScreenTimeoutSetting {
switch (value) {
case "15s":