Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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. –  cadadr Feb 13 '13 at 17:25
add comment

2 Answers 2

up vote 5 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. –  cadadr Feb 13 '13 at 17:45
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.