Software & AppsOperating SystemLinux

How To Set Your Primary Monitor on Ubuntu for Multiple Monitors

Ubuntu 21

In the world of Linux, Ubuntu is a popular and user-friendly distribution that many people use. One of the many features it offers is the ability to manage multiple monitors. This article will guide you on how to set your primary monitor on Ubuntu when using multiple monitors.

Quick Answer

To set your primary monitor on Ubuntu for multiple monitors, you have several options. You can use the "Displays" application in the system settings to easily switch the primary monitor. Alternatively, you can drag the menu bar to your preferred primary monitor in the "System Settings" > "Displays" menu. For advanced users, editing the ~/.config/monitors.xml file or using the Nvidia settings tool or XRANDR command are also viable methods. Choose the method that suits your comfort level and needs.

Understanding Primary Monitor

Before we delve into the process, it’s important to understand what a primary monitor is. The primary monitor is the main display where your desktop icons and system dialogs appear. When using multiple monitors, you can choose which monitor is the primary one.

Setting Your Primary Monitor

There are several methods to set your primary monitor in Ubuntu. We will explore each one in detail.

Method 1: Using the “Displays” Application

This is the simplest method and doesn’t require any command-line knowledge.

  1. Open the “Displays” application from the system settings.
  2. Turn off the current primary monitor.
  3. The secondary monitor will automatically become the primary.
  4. Turn on the old primary monitor again to have both displays active.

Method 2: Dragging the Menu Bar

Another method is to use the graphical interface to drag the menu bar to your preferred primary monitor.

  1. Go to “System Settings” > “Displays”.
  2. Hover over the menu bar on your secondary monitor.
  3. Click and drag it over to your preferred primary monitor.
  4. Adjust the “Launcher Placement” dropdown to reflect the desired monitor.
  5. Click “Apply” to save the changes.

Method 3: Editing the ~/.config/monitors.xml File

For those comfortable with command-line operations, you can edit the ~/.config/monitors.xml file to set your primary monitor.

  1. Open the ~/.config/monitors.xml file with a text editor like nano or vim. For example, nano ~/.config/monitors.xml.
  2. Identify the main monitor and change <primary>no</primary> to <primary>yes</primary>.
  3. Save the file and restart your session.

The ~/.config/monitors.xml file stores the configuration of your monitors. The <primary> tag indicates whether a monitor is the primary one or not.

Method 4: Using the Nvidia Settings Tool

If you’re using an Nvidia graphics card, you can use the Nvidia settings tool to set your primary monitor.

  1. Open a terminal and run sudo nvidia-settings to start the Nvidia Settings Configuration.
  2. Select the “X Server Display Configuration” tab.
  3. Choose the monitor you want to set as the primary.
  4. Check the “Make this the primary display for the X screen” checkbox.
  5. Click “Apply” to save the changes.
  6. Run sudo nvidia-xconfig to make the change persistent through reboots.

The nvidia-settings command opens the Nvidia settings tool. The nvidia-xconfig command saves your changes to the X server configuration file, ensuring they persist after a reboot.

Method 5: Using the XRANDR Command

The xrandr command is a powerful tool for managing screen resolution and monitor settings.

  1. Open a terminal and run xrandr to check for available connection names.
  2. Identify the desired primary monitor and run xrandr --output <monitor_name> --primary.
  3. Check the output with xrandr again to verify the changes.

The --output parameter specifies the monitor, and --primary sets it as the primary monitor.

Conclusion

Setting your primary monitor in Ubuntu when using multiple monitors is a straightforward process, whether you prefer using the graphical interface or the command line. Choose the method that suits your comfort level and needs. Remember, the specific method that works for you may depend on your Ubuntu version, desktop environment, and graphics card. Happy computing!

Can I set a different primary monitor for each user on Ubuntu?

No, the primary monitor setting is system-wide and applies to all users.

Will changing the primary monitor affect the position of my desktop icons?

Yes, changing the primary monitor may rearrange the position of your desktop icons. You may need to manually rearrange them after changing the primary monitor.

Can I set a primary monitor using the command line in Ubuntu?

Yes, you can use the xrandr command to set a primary monitor through the command line. Method 5 in the article explains how to do this.

Do I need to restart my computer after changing the primary monitor?

In most cases, you do not need to restart your computer after changing the primary monitor. However, if you experience any issues, you may try restarting your session or rebooting your computer.

Can I set a primary monitor if I have different graphics cards?

Yes, you can set a primary monitor even if you have different graphics cards. The methods mentioned in the article should work regardless of the graphics card you are using.

Will changing the primary monitor affect my screen resolution?

Changing the primary monitor should not affect your screen resolution. However, if you experience any issues with the resolution after changing the primary monitor, you can adjust it using the display settings or the xrandr command.

Leave a Comment

Your email address will not be published. Required fields are marked *