@projecteuler have you tried sourcing ". ~/.profile" from xsession? make sure the environment is properly set up, compare "env" output in both