Add JSONRPC handling

This commit is contained in:
Daniel Lorch 2025-05-20 01:02:38 +02:00
parent 9698564550
commit 6dd65fbba6
1 changed files with 12 additions and 0 deletions

View File

@ -877,6 +877,18 @@ func rpcSetCloudUrl(apiUrl string, appUrl string) error {
return nil
}
func rpcGetKeyboardLayout() (string, error) {
return config.KeyboardLayout, nil
}
func rpcSetKeyboardLayout(layout string) error {
config.KeyboardLayout = layout
if err := SaveConfig(); err != nil {
return fmt.Errorf("failed to save config: %w", err)
}
return nil
}
func getKeyboardMacros() (interface{}, error) {
macros := make([]KeyboardMacro, len(config.KeyboardMacros))
copy(macros, config.KeyboardMacros)