Project

General

Profile

Feature #383

Updated by Daniel Curtis over 10 years ago

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

 
 Each of these mechanisms will be discussed in turn. 

 h2. 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: 
 <pre> 
 xrandr --output VGA-0 --mode 800x600 
 </pre> 

 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. 

 h2. 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. 

 h2. 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: 
 <pre> 
 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 
 </pre> 

 h2. Resources 

 * https://wiki.ubuntu.com/X/Config/Resolution#Setting_xrandr_commands_in_.xprofile

Back