[Ref: OpenBSD 6.5, FAQ: The X Window System]
Each person’s preferred work environment is different, in this guide we adapt on many fine online tutorial to see if we can understand some of the landscape for a Graphical Desktop Environment (GDE) on OpenBSD.
The Graphical Desktop Environment (GDE), is standard for most desktops. Those extra pixels on large screens are magnets for more terminal screens, and the occassional web browser etc. The graphical workstation desktop is (as with most things in Unix) built from various software components:
[Ref: FAQ: The X Window System]
From the FAQ:
The X Window System (sometimes just called “X”, other times, incorrectly called “X Windows”) is the environment which provides graphics services to OpenBSD and other Unix-based systems.
The relevant warning is inside the FAQ
Sometimes things go really bad. Yes, it is usually good to get X running before you load critical applications on the system. Sometimes, a bad X configuration will hang the entire machine to the point that only a hard reset will resolve the problem.
The FAQ contains useful techniques, examples for identifying and modifying configuration settings to get you up and running with a Graphical User environment.
[Ref: xrandr]
Follow the FAQ - The X Window System should have you inside a Windowing environment. In previous versions of X, configuration was mostly through the xorg.conf file, but I can’t find an xorg.conf file on the system, so looking at the ‘current’ way of doing things using xrandr.
The xrandr] man page has some good examples, to help you understand how the program works, so we look at my situation and see what I can/need to do.
Scenario:
When X-Windows is started up, I get a functioning login screen, but after logging in, the monitor is logically to the right of the laptop (i.e. to move my mouse onto the LEFT monitor, I have to move the mouse RIGHT)
# xrandr
Screen 0: minimum 320 x 200, current 3046 x 1050, maximum 8192 x 8192
eDP-1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 344m m x 194mm
1366x768 60.03*+ 40.01
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
...
VGA-1 connected 1680x1050+1366+0 (normal left inverted right x axis y axis) 473mm x 291mm
1680x1050 59.95*+
1600x900 60.00
1280x1024 75.02 60.02
...
HDMI-1 disconnected (normal left inverted right x axis y axis)
The ‘xrandr’ output tells me of three video devices.
Remember, the logical display given by X, isn’t the same as the physical display.
From the manpage:
--left-of, --right-of, --above, --below, --same-as another-output Use one of these options to position the output relative to the position of another output. This allows convenient tiling of outputs within the screen. The position is always computed rel- ative to the new position of the other output, so it is not valid to say --output a --left-of b --output b --left-of a.
The following will re-arrange the monitors as they physically are.
# xrandr --output VGA-1 --left-of eDP-1
# xrandr
Screen 0: minimum 320 x 200, current 3046 x 1050, maximum 8192 x 8192
eDP-1 connected primary 1366x768+1680+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.03*+ 40.01
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
...
VGA-1 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 291mm
1680x1050 59.95*+
1600x900 60.00
1280x1024 75.02 60.02
...
HDMI-1 disconnected (normal left inverted right x axis y axis)
You can see from the resolution/positioning information, the original positioning of the monitors beings with the internal monitor eDP-1 at position +0+0, whilst the secondary monitor VGA-1 starts at position +1366+0 (where 1366 is the x resolution of the eDP-1 monitor. )
After the change, the +0+0 position is with VGA-1 and eDP-1 configuration is after the x-resolution for VGA-1 (i.e. +1680+0)
But, I wan’t the have the monitor in portrait layout, instead of the landscape layout (a bit of MS Windows language here.)
From the manpage:
--rotate rotation Rotation can be one of 'normal', 'left', 'right' or 'inverted'. This causes the output contents to be rotated in the specified direction. 'right' specifies a clockwise rotation of the picture and 'left' specifies a counter-clockwise rotation.
Now, physically I’ve achieved portrait mode by rotating the screen clockwise (to the right.) This is how I can tell the X screen to have the same behaviour.
# xrandr --output VGA-1 --rotate left
# xrandr
Screen 0: minimum 320 x 200, current 3046 x 1680, maximum 8192 x 8192
eDP-1 connected primary 1366x768+1680+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.03*+ 40.01
1280x720 60.00 59.99 59.86 59.74
1024x768 60.04 60.00
...
VGA-1 connected 1050x1680+0+0 left (normal left inverted right x axis y axis) 473mm x 291mm
1680x1050 59.95*+
1600x900 60.00
1280x1024 75.02 60.02
...
HDMI-1 disconnected (normal left inverted right x axis y axis)
The display information for VGA-1 changed from one to the second:
The resolution is flipped, and the specified rotation (left) has been applied.
Alternatively, you’re display manager (be it gnome, kde, or otherwise) may have a utility that can perform the configuration for you. Gnome’s configuration tools can set and relocate monitors very well..