diff --git a/app/src/socketBridge.ts b/app/src/socketBridge.ts index da1cdbc..7c93628 100644 --- a/app/src/socketBridge.ts +++ b/app/src/socketBridge.ts @@ -94,6 +94,7 @@ export type DaemonEvt = | { evt: "layout_changed"; data: { workspace_id: string } } | { evt: "workspace_changed"; data: unknown } | { evt: "groups_changed"; data: unknown } + | { evt: "config_changed"; data: { config: ConfigView } } | { evt: "event"; data: { record: EventRecord } } | { evt: "events_read"; data: { ids: number[] } }; @@ -186,3 +187,27 @@ export async function getHealth(): Promise { export async function setZoom(workspaceId: string, surfaceId: string | null): Promise { await invoke("set_zoom", { workspaceId, surfaceId }); } + +// ---- Settings ---- + +export interface ConfigView { + default_shell: string; + font_family: string; + font_size: number; + theme: "dark" | "light"; + accent: string; +} + +export async function getConfig(): Promise { + return await invoke("get_config"); +} + +export async function setConfig(patch: Partial>): Promise { + await invoke("set_config", { + defaultShell: patch.default_shell ?? null, + fontFamily: patch.font_family ?? null, + fontSize: patch.font_size ?? null, + theme: patch.theme ?? null, + accent: patch.accent ?? null, + }); +}