Project

General

Profile

Feature #383

Setting The Screen Resolution at Boot Time

Added by Daniel Curtis over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
05/01/2014
Due date:
% Done:

100%

Estimated time:
0.50 h
Spent time:

Description

There are a few ways to make xrandr customizations permanent from session to session:
  1. .xprofile
  2. kdm/gdm
  3. xorg.conf

Each of these mechanisms will be discussed in turn.

Setting xrandr commands in .xprofile

A user's ~/.xprofile file is executed on Xorg startup if it exists and is executable. You can copy and paste xrandr command line strings into this file so they're executed when you log in. For example:

xrandr --output VGA-0 --mode 800x600

There are two disadvantages to using .xprofile for xrandr settings. First, it occurs fairly late in the startup process, so you'll see some resolution resizing during the initial screen draw; in some cases panel windows may resize improperly as a result. Second, as this is a per-user setting, it won't affect the resolutions of other users, nor will it alter the resolution on the login screen.

Setting xrandr commands in kdm/gdm startup scripts

Both KDM and GDM have startup scripts that are executed when X is initiated. For GDM, these are in /etc/gdm/ , while for KDM this is done at /etc/kde4/kdm/Xsetup. In either case, you can paste in an xrandr command line string into one of these scripts. For GDM, try putting them right before the following line in /etc/gdm/Init/Default:

initctl -q emit login-session-start DISPLAY_MANAGER=gdm

This process requires root access and mucking around in system config files, but will take effect earlier in the startup process than using .xprofile, and will apply to all users including the login screen.

Setting resolution changes in xorg.conf

While xorg.conf is largely empty these days, it can still be used for setting up resolutions. For example:

Section "Monitor" 
    Identifier      "External DVI" 
    Modeline        "1280x1024_60.00"  108.88  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
    Option          "PreferredMode" "1280x1024_60.00" 
EndSection
Section "Device" 
    Identifier      "ATI Technologies, Inc. M22 [Radeon Mobility M300]" 
    Driver          "ati" 
    Option          "Monitor-DVI-0" "External DVI" 
EndSection
Section "Screen" 
    Identifier      "Primary Screen" 
    Device          "ATI Technologies, Inc. M22 [Radeon Mobility M300]" 
    DefaultDepth    24
    SubSection "Display" 
        Depth           24
        Modes   "1280x1024" "1024x768" "640x480" 
    EndSubSection
EndSection

Section "ServerLayout" 
        Identifier      "Default Layout" 
        Screen          "Primary Screen" 
EndSection

Resources

Also available in: Atom PDF