Change display settings from the command line

Is it possible to change display settings (such as joining displays or mirroring displays) from the command line?

I use a remote client that doesn’t handle changes in display settings well. If I need to remote in and switch from join to mirror displays, the remote session loses its display and I need to reset the display before the prompt times out. I tried Super+P but that broke the display setup in a worse way…all that to say, it would make a lot more sense to change these settings without a time sensitive prompt to keep them. Thanks.

There is GitHub - jadahl/gnome-monitor-config. It needs to be run from within the same D-Bus session as gnome-shell.

Very nice, thank you.