8

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.

1
  • BTW, a hack is a .xprofile that runs .xsession.
    – user91091
    Feb 13, 2013 at 17:25

2 Answers 2

9

~/.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.

1
  • Thanks! moving .Xdefaults to .Xresources solved my problem. And thanks again, for other useful tips.
    – user91091
    Feb 13, 2013 at 17:45
-1

A note: in Ubuntu 12.03 .xsessionrc is also ignored

to solve it:

open

./Xsession.d/40x11-common_xsessionrc

at the beginning, add

USERXSESSIONRC=$HOME/.xsessionrc

this is the final content:

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

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

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

You must log in to answer this question.