How to Configure Screen Resolution on Arch Linux

How to Configure Screen Resolution on Arch Linux

Configuring screen resolution is a crucial part of getting your Arch Linux setup to look and function just the way you want it. Whether you’re using a desktop environment like GNOME or KDE, a lightweight window manager like i3 or Openbox, or even no GUI at all, it’s important to know how to set and persist screen resolution settings.

In this guide, we’ll explore how to configure screen resolution on Arch Linux using various methods — from command-line tools to graphical utilities — ensuring compatibility with different setups.


1. Understanding Screen Resolution on Linux

Before diving into configuration, let’s clarify what screen resolution means. Screen resolution refers to the number of pixels displayed on the screen. Common resolutions include 1920x1080 (Full HD), 2560x1440 (2K), and 3840x2160 (4K).

On Linux, screen resolution is handled by the X server (X11), Wayland (for modern environments), or by the framebuffer in non-graphical setups. Most desktop environments provide tools to manage this graphically, but command-line utilities are essential for more fine-tuned or minimal installations.


2. Checking Your Current Screen Resolution

To check your current screen resolution, use:

xrandr

This command outputs something like:

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm
   1920x1080     60.00*+
   1280x1024     75.02  
   1024x768      60.00  

The line with *+ indicates the active mode (in this case, 1920x1080).


3. Configuring Screen Resolution Using xrandr

A. Setting a Resolution Temporarily

You can change the screen resolution like so:

xrandr --output HDMI-1 --mode 1280x1024

Replace HDMI-1 with your actual display name from the xrandr output, and set the desired mode.

This change is temporary and will reset on reboot.


B. Adding Custom Resolutions with cvt and xrandr

If your desired resolution isn’t listed, you can create it manually:

  1. Generate a new mode line with cvt:

    cvt 1366 768
    

    Output:

    # 1366x768 59.79 Hz (CVT 1.05M3) hsync: 47.71 kHz; pclk: 85.50 MHz
    Modeline "1366x768_60.00" 85.50 1366 1436 1579 1792 768 771 774 798 -hsync +vsync
    
  2. Add the new mode to xrandr:

    xrandr --newmode "1366x768_60.00" 85.50 1366 1436 1579 1792 768 771 774 798 -hsync +vsync
    xrandr --addmode HDMI-1 1366x768_60.00
    xrandr --output HDMI-1 --mode 1366x768_60.00
    

This method is helpful when using uncommon monitors or projectors.


4. Making Screen Resolution Persistent

Temporary changes are fine for one-time adjustments, but to keep the resolution after reboot, you need to make it persistent.

A. Using .xprofile or .xinitrc

If you’re launching X manually or through a minimal window manager, add your xrandr commands to:

  • ~/.xprofile (executed by most display managers)
  • or ~/.xinitrc (used when starting X with startx)

Example .xprofile:

#!/bin/bash
xrandr --newmode "1366x768_60.00" 85.50 1366 1436 1579 1792 768 771 774 798 -hsync +vsync
xrandr --addmode HDMI-1 1366x768_60.00
xrandr --output HDMI-1 --mode 1366x768_60.00

Make sure the script is executable:

chmod +x ~/.xprofile

B. Using Xorg Configuration Files

For a more system-wide solution, you can create an Xorg configuration file:

sudo mkdir -p /etc/X11/xorg.conf.d/

Create a file like 10-monitor.conf:

sudo nano /etc/X11/xorg.conf.d/10-monitor.conf

Example content:

Section "Monitor"
    Identifier "HDMI-1"
    Modeline "1366x768_60.00" 85.50 1366 1436 1579 1792 768 771 774 798 -HSync +Vsync
    Option "PreferredMode" "1366x768_60.00"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device     "Card0"
    Monitor    "HDMI-1"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1366x768_60.00"
    EndSubSection
EndSection

Be cautious: incorrect configuration can prevent X from starting.


5. Configuring Resolution in Wayland Sessions

If you’re using a modern desktop environment like GNOME or KDE on Wayland, the steps differ.

A. GNOME (Wayland)

GNOME provides a graphical utility under:

Settings → Displays

Here you can choose resolution, orientation, and scaling. Changes are saved automatically.

For advanced tweaks (like fractional scaling or custom resolutions), Wayland is more restrictive than X11. Tools like wlr-randr or configuration through the compositor (e.g., Sway) are used instead.

B. KDE Plasma (Wayland)

Navigate to:

System Settings → Display and Monitor → Display Configuration

Just like GNOME, settings are saved and persistent.

Wayland in KDE is improving, but some configurations may still need X11 if advanced control is required.


6. Using Display Managers and Desktop Environments

A. XFCE

XFCE’s Display Settings (found in Settings → Display) allow you to set the resolution per monitor and save them to .config/xfce4/xfconf/xfce-perchannel-xml/displays.xml.

You can also save profiles for different monitor setups.

B. LXQt / Openbox

LXQt uses lxqt-config-monitor, and Openbox users can use arandr (a GUI for xrandr) to configure resolution and export scripts.

Install arandr:

sudo pacman -S arandr

Launch it, make your changes, then save the layout as a script and call it in .xprofile.


7. Headless or CLI-Only Setups

In CLI or headless setups (no desktop environment), screen resolution may need to be set via:

A. Kernel Parameters

For the TTY framebuffer, edit GRUB’s config:

sudo nano /etc/default/grub

Set:

GRUB_GFXMODE=1366x768
GRUB_GFXPAYLOAD_LINUX=keep

Then regenerate the config:

sudo grub-mkconfig -o /boot/grub/grub.cfg

B. Using fbset

Install fbset:

sudo pacman -S fbset

And run:

sudo fbset 1366x768-60

Note: this only works for framebuffer consoles and not graphical environments.


8. Troubleshooting Tips

  • Resolution not showing up? Use cvt and xrandr to add custom resolutions.
  • Changes not persisting? Double-check .xprofile, .xinitrc, or Xorg config files.
  • Multiple monitors? Use xrandr to specify positions (--left-of, --right-of, etc.).
  • Wayland limitations? Some advanced options like custom modelines may not be supported.

9. Conclusion

Arch Linux provides powerful tools for configuring screen resolution, whether you’re running a full desktop environment or a lean window manager. xrandr and cvt are your best friends on X11, while desktop environments on Wayland simplify the process through graphical tools.

As with many things in Arch, flexibility comes at the cost of a steeper learning curve — but with the right tools and knowledge, you can tailor your display setup exactly to your needs.

Whether you’re gaming on a 4K monitor, giving a presentation through a projector, or just trying to make your laptop’s display more comfortable, mastering screen resolution settings is a vital part of customizing your Linux experience.