You are not logged in.

#1 2013-03-14 01:08:20

whatshisname
Member
Registered: 2010-04-24
Posts: 163

[SOLVED] Starting X at login in Systemd. No display manager.

I'm confused about the instructions in the Wiki on this topic.  I can't decide whether I'm doing something right or wrong so I thought I'd see what others think.

I'm on my 3rd install of the new systemd Arch.

My goal is to start X automatically without using a display/login manager.

First, my .xinitrc:

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

xrdb -merge ~/.Xresources         # update x resources db

exec startlxde

To begin, I follow the instructions here: https://wiki.archlinux.org/index.php/Au … al_console

After I get successfully logged into my console, I follow the instructions here: https://wiki.archlinux.org/index.php/Start_X_at_Login

According to the instructions for starting X at login, all one needs do is add:

    [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

to the end of .bash_profile.

This just doesn't work for me.  To troubleshoot what's going on, I issue "echo $DISPLAY" while I'm at the console after my failed attempt to start X.

It returns ":0".

Since the conditional expects nothing for "$DISPLAY", it fails and X doesn't start.

I've changed the conditional above to:

[[ $DISPLAY = :0 && $XDG_VTNR -eq 1 ]] && exec startx

And lxde starts up on boot.

I'm inclined to edit the Wiki to reflect my experience but am reluctant dispute what the author says.  So I'm wondering if anyone else has had the same experience I'm having or else can give me insight as to why my $DISPLAY environment variable equals ":0" instead of nothing.

Thanks.

[Edited to remove superfluous link to Wiki.]

Last edited by whatshisname (2013-03-14 13:33:21)

Offline

#2 2013-03-14 01:27:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] Starting X at login in Systemd. No display manager.

Don't edit the wiki, it is correct on that point.  Something is faulty with your system setting the DISPLAY variable.

Have you checked to ensure no other X session is running when this happens?

Also, can you post your full .bash_profile and .bashrc?  Note that the wiki shouldn't say to put that at the end of your .bash_profile, but rather at the beginning.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2013-03-14 02:48:42

whatshisname
Member
Registered: 2010-04-24
Posts: 163

Re: [SOLVED] Starting X at login in Systemd. No display manager.

Trilby wrote:

Don't edit the wiki, it is correct on that point.  Something is faulty with your system setting the DISPLAY variable.

That's what I figured which is why I made my post and, indeed, you were right, Trilby.

I was in the process of posting my .bashrc file, a file that's followed me through many iterations of Linux, when I noticed:

#  So I can run remote X applications on another machine
export DISPLAY=:0

Somewhere along the way in my Linux life, while trying to get ssh with X forwarding working, I added that line to my .bashrc.

That was causing the conditional to fail.

Thanks for the feedback, Trilby.

I'll wait until you read this reply then I'm going to delete this nonsense! :-)

Offline

#4 2013-03-14 03:07:53

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,177

Re: [SOLVED] Starting X at login in Systemd. No display manager.

whatshisname wrote:

I'll wait until you read this reply then I'm going to delete this nonsense! :-)

Please! DO NOT DO THAT. 
Post blanking is a serious faux pas on these forums and is an excellent way to earn a temporary ban.  These forums are intended to help everyone, not just the original poster.  We can all learn from other's mistakes.

Our Policy

Last edited by ewaller (2013-03-14 03:08:19)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Online

#5 2013-03-14 13:26:28

whatshisname
Member
Registered: 2010-04-24
Posts: 163

Re: [SOLVED] Starting X at login in Systemd. No display manager.

ewaller wrote:
whatshisname wrote:

I'll wait until you read this reply then I'm going to delete this nonsense! :-)

Please! DO NOT DO THAT. 
Post blanking is a serious faux pas on these forums and is an excellent way to earn a temporary ban.

Oh, OK.  I wouldn't want that to happen.

These forums are intended to help everyone, not just the original poster.  We can all learn from other's mistakes.

Fair enough.  Marking this one solved.

Offline

Board footer

Powered by FluxBB