Destructive overwriting of KeyBindings.xml?

Is there a way to destructively overwrite the KeyBindings.xml?
Or, alternatively, let’s say you have a script with 150 shortcuts, providing the KeyBindings.xml rows for those specific shortcuts and banging them into your current KeyBindings.xml setting?

You’re basically just asking to modify a text file. With Lua you can do that “easily”.

You should check if Renoise modifies the Keybindings.xml file when you log out.

If you don’t modify this file, you can build a Lua tool that modifies the text inputs. You should study the structure of this file to be able to replace keys.

The only thing necessary would be to restart Renoise (log out and reopen) for it to load the changes. I assume that Renoise reads this file upon login. You just have to ask yourself what happens to this file “during the session”.

Renoise will overwrite the keybindings.xml file again when closing the application. You would need to do this in a separate tool - outside of Renoise, while Renoise is closed.

ouch. so basically, i’d need to start up a terminal from within the lua script, which forcequits Renoise, then hope against hope it didn’t stop the terminal.app after forcequitting, then overwrite the keybindings and then restart renoise again.

d’you think it’s possible to make that happen? i could probably pull it off… - but if forcequitting renoise quits terminal, then i’m in trouble. i could try and fiddle with it, i guess.

ok, wow. it worked. i was able to killall Renoise - then continue running the script and then open -a Renoise.app at the end of the script.

obv this requires figuring out if the user is on macOS, Windows or Linux, and different flavors of the script should then be run.