| 278 | } |
| 279 | |
| 280 | function writeAutomationStore(path) { |
| 281 | if (!existsSync(path)) { |
| 282 | throw new Error(`Store not found: ${path}`); |
| 283 | } |
| 284 | |
| 285 | const originalStoreContents = readFileSync(path, "utf8"); |
| 286 | const originalStore = JSON.parse(originalStoreContents); |
| 287 | const nextStore = { |
| 288 | ...originalStore, |
| 289 | hotkeys: { |
| 290 | hotkeys: { |
| 291 | ...(originalStore.hotkeys?.hotkeys ?? {}), |
| 292 | startStudioRecording: HOTKEYS.startStudioRecording, |
| 293 | stopRecording: HOTKEYS.stopRecording, |
| 294 | }, |
| 295 | }, |
| 296 | recording_settings: { |
| 297 | ...(originalStore.recording_settings ?? {}), |
| 298 | mode: "studio", |
| 299 | target: null, |
| 300 | }, |
| 301 | }; |
| 302 | |
| 303 | writeFileSync(path, `${JSON.stringify(nextStore, null, 2)}\n`); |
| 304 | |
| 305 | return originalStoreContents; |
| 306 | } |
| 307 | |
| 308 | function modifiersForHotkey(hotkey) { |
| 309 | return [ |