The `xrandr` utility can be used to configure outputs for X11 from the command line. For example, you can use it to configure and inspect resolution, position (relative to other monitors), rotation, scaling, refresh rate, DPI, and much more. It can even apply geometric transformations.
As an example, since I don't use a desktop environment, I have a script that detects when I connect/disconnect my laptop to/from its dock, and applies the appropriate monitor configuration.
Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.