Where is .xprofile in Ubuntu 13.10?

16,174

By default there is no .xprofile file in your home directory unless you create one. The instructions for making an .xprofile file are found here under the How to setup a dual monitor heading in the Ubuntu Resolution wiki.

Use your favorite editor to create ~/.xprofile containing something like:

xrandr --output VGA1 --mode 1024x768 --rate 60

Now that command will be run every time your start your Xsession. You can force it to run by logging out and logging back in or by executing ~/.xprofile from your terminal.

Here is an example of my ~/.xprofile. The # are for comments just like you do with shell scripts. The purpose of my setup is sometime have laptop on the left and other times I have my laptop on the right. This makes very simple and easy to change which side you want each monitor to be on. I just added the information on how to set your primary monitor.

xrandr --output VGA1 --mode 1024x768 --rate 60

#Laptop right extra Monitor Left
#xrandr --output VGA1 --left-of LVDS1

#Laptop left extra Monitor right
xrandr --output LVDS1 --left-of VGA1

#This is to set your primary monitor.

#This sets your laptop monitor as your primary monitor. 
xrandr --output LVDS1 --primary

#This sets your VGA monitor as your primary monitor. 
#xrandr --output VGA1 --primary

Some people think it is a disadvantage that this only works for one user, other people think this is an advantage. If you want to be able to use this just copy it over to your profile folder.

Important Note: If you just blindly copy some commands from a website, you may see an error message:

xrandr: cannot find mode 1024×768

This may be due to some CMS' way of modifying content: xrandr expects the letter x and not the multiplication cross × between horizontal and vertical resolution.

Incorrect example:

xrandr --output VGA1 --mode 1024×768 --rate 60

Corrected example:

xrandr --output VGA1 --mode 1024x768 --rate 60
Share:
16,174

Related videos on Youtube

stragu
Author by

stragu

Updated on September 18, 2022

Comments

  • stragu
    stragu over 1 year

    The question is in the title. I have seen a few articles and answers talking about configuring .xprofile, file that is supposed to be in my home directory. I have selected "show hidden files" but .xprofile is nowhere to find. Any idea?