Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started using uxterm instead of Gnome's terminal today. I put settings for uxterm in ~/.Xdefaults. But because Ubuntu's configuration ignores my .xsession file, I can't have these settings loaded at login. How can I get Unity (or lightdm) to run .xsession? My .xsession is recognized and run by XMonad.

share|improve this question
BTW, a hack is a .xprofile that runs .xsession. – user91091 Feb 13 '13 at 17:25
up vote 9 down vote accepted

~/.xsession is only used when no X session is selected. Use ~/.xsessionrc to run programs at startup.

As using ~/.Xdefaults is obsolete, Ubuntu, like about any other modern X environment, uses ~/.Xresources at startup (see for example here for some reasons). So if you put your settings in ~/.Xresources you don't need to run xrdb as Ubuntu is doing this for you.

See /etc/X11/Xsession and /etc/X11/Xsession.d/* if you want to know more about what Ubuntu is doing when you start a X session.

share|improve this answer
Thanks! moving .Xdefaults to .Xresources solved my problem. And thanks again, for other useful tips. – user91091 Feb 13 '13 at 17:45

A note: in Ubuntu 12.03 .xsessionrc is also ignored

to solve it:



at the beginning, add


this is the final content:

# This file is sourced by Xsession(5), not executed.

#Source user defined xsessionrc (locales and other environment variables)
if [ -r "$USERXSESSIONRC" ]; then

I don't know if it's solved in versions >12.04

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.