My Adventures with Multiple Monitors on Linux
Using multiple monitors on my Linux laptop has introduced a couple of unique issues. The largest of which is that the laptop seems to forget my monitor configuration every time I unplug it.
This article is going to discuss how I addressed this problem and how I spanned my desktop wallpaper. But first, a bit about my set-up:
- OS: Fedora 21
- Desktop Environment: Gnome 3
- Monitors: 3
- Video Driver: i915
Position Monitors
My solution to this problem is pretty basic, a bash script that configures my displays for work via xrandr. In order to get started run xrandr --current
to get the current monitor configuration.
This information alone may not be enough to determine which monitor is which. To figure that out I disabled and enabled one monitor at a time:
xrandr --output HDMI1 --off
xrandr --output HDMI1 --auto
Once you have identified the monitors you can easily script a solution to position them as needed; run xrandr --help
to see all configuration options available. I recommend running it with the auto flag against all displays as it will turn the specified output on if it is off and set the preferred (maximum) resolution.
Here is my script:
#!/bin/bash
#Configure laptop for work set-up.
#Turns monitors on, set monitor positions, \
#maximum resolution, and sets primary monitor.
xrandr --output HDMI1 --left-of VGA1 --auto
xrandr --output eDP1 --right-of VGA1 --auto
xrandr --output VGA1 --primary --auto
Once the script is made just add execute permissions and run it post login!
Span Wallpaper A less critical problem that I ran into was the lack of option to span my desktop wallpaper across multiple monitors with Gnome 3. The option is still there, but was removed from the GUI for some reason. Here is the commend to span the wallpaper from the command line:
gsettings set org.gnome.desktop.background picture-options "spanned"
Possible values are “none”, “wallpaper”, “centered”, “scaled”, “stretched”, “zoom”, “spanned”.