Change color background and layout with a simple shortcut

I find convenient to be able to program with the classic layout (white) but to be able to put the dark mode (less blinding with thoses macbook pro) when I am playing. Is there a way to map a simple keyboard shortcut in order to alternate easily between thoses two layouts? Thanks.

You can assign a keyboard binding to any of the commands in Preferences > Shortcuts.

The trouble for your use case is that I don’t see a command to switch color theme.

So the feature would need to be added in C++ first.