You are not logged in.

#1 2014-01-21 18:54:51

Ace
Member
Registered: 2014-01-21
Posts: 10

Xfce auto start problem

Hello, First time posting so don't punish me for any mistakes big_smile
Here is the problem:
After removing gnome and installing xfce Arch doesn't go into GUI mode automatically.
I am stuck at the command line.
From there I can type startxfce4 and it work but I want it do to start automatically.
This is my .xinitrc file

#!/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



# exec gnome-session
# exec startkde
exec startxfce4
# ...or the Window Manager of your choice

and this is my .bash_profile

# ~/.bash_profile
#

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

Any inputs are highly appreciated!!

Last edited by Ace (2014-01-21 18:55:13)

Offline

#2 2014-01-21 20:04:47

toz
Member
Registered: 2011-10-28
Posts: 497

Re: Xfce auto start problem

Should work. Is bash your login shell?

Offline

#3 2014-01-21 20:47:51

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

I believe yes , but noob here big_smile
how do I check?

Offline

#4 2014-01-21 20:51:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Xfce auto start problem

Does

pgrep -f -- -bash

return anything?

Offline

#5 2014-01-21 20:58:45

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

Yes. 269

Offline

#6 2014-01-21 21:01:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Xfce auto start problem

That's the PID of the bash login process - you're using bash as your login shell.

What's the output of

echo $XDG_VTNR

?

Offline

#7 2014-01-21 21:02:34

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

Nothing
Just blank...

echo $DISPLAY returns :0.0

Last edited by Ace (2014-01-21 21:13:52)

Offline

#8 2014-01-21 21:11:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Xfce auto start problem

Interesting.
Change the line saying

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

to

[[ -z $DISPLAY ]] && exec startx

and reboot to see if it works now.

Offline

#9 2014-01-21 21:16:28

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

No still stuck in terminal log in.
I need to type startxfce4 manually sad

Offline

#10 2014-01-22 00:13:46

toz
Member
Registered: 2011-10-28
Posts: 497

Re: Xfce auto start problem

echo $DISPLAY returns :0.0

Whats interesting is that you're getting a $DISPLAY value when you're not logged into an X session. AFAIK, this value only gets set when you get an X session. Are you running this command from the console before startx? Is X running on another virtual terminal?

What's the output of

echo $XDG_VTNR

?

Nothing
Just blank...

Also, not getting a value for $XDG_VTNR is odd. As per https://bbs.archlinux.org/viewtopic.php?pid=1214794, are you running systemd and is your pam environment setup properly?

Offline

#11 2014-01-22 19:39:48

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

Sorry I posted the value after i startx and already in xfce
before in the terminal login DISPLAY value is blank and
$XDG_VTNR is 1
if I understoo correctly yes
systemd is running and I dont know if it helps but graphical.target is also running and active
as for pam enviroment I don't know how to check what you want do know...

Offline

#12 2014-01-22 19:58:24

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Xfce auto start problem

Put a bit of debugging info in your script, to remove some uncertainty. E.g.:

echo "Checking whether to run xorg"

First run this, to be on safe side:

chmod 700 ~/.bash_profile

Here's how I do it, in my ~/.bash_profile

# My ~/.bashrc does everything - convenient, but slightly un-optimized
. $HOME/.bashrc

hour=$(date +%k | sed "s:^ ::")
if [[ $hour -ge 8 ]] && [[ $hour -le 9 ]] ; then
    if [[ `tty` == "/dev/tty1" ]] && [[ -z `pgrep ^X$` ]] ; then
        if lsmod | grep -qw ^nvidia ; then
            echo "Starting xorg"
            # https://bbs.archlinux.org/viewtopic.php?id=150539
            setsid /usr/bin/startx -- -nolisten tcp &> ~/.xorg.log & logout
        fi
    fi
fi

Edit: Oops, got a bit confused, ignore this last line sad

Last edited by brebs (2014-01-22 20:07:52)

Offline

#13 2014-01-22 20:03:28

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Xfce auto start problem

brebs wrote:

You had "!/bin/sh" at the top of your ~/.bash_profile - which is weird, so remove it.

Do you mean his ~/.xinitrc? I have it too.

Offline

#14 2014-01-22 20:08:04

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

!/bin/sh is not in my bash profile is on .xinitrc and is commented so there is no problem.
I put the echo in bash_profile and nothing came out.

Offline

#15 2014-01-22 20:09:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Xfce auto start problem

Ace wrote:

!/bin/sh is not in my bash profile is on .xinitrc and is commented so there is no problem.

This is a special kind of comment https://en.wikipedia.org/wiki/Shebang_(Unix)

Offline

#16 2014-01-22 20:12:23

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Xfce auto start problem

Oops, I got the 2 files confused there. It's not a problem. I don't thave that line, I don't believe it makes any difference.

Offline

#17 2014-01-22 20:12:29

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

Thumbs up for the reading. karol big_smile
Learned a new thing.

Offline

#18 2014-01-22 20:13:52

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

Has anyone any input on how to start the xfce automatically ?
It is a pain to start it manually tongue

Offline

#19 2014-01-22 20:15:58

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Xfce auto start problem

Read what I wrote.

At least add an echo command or two to your script, to see if it's running.

Offline

#20 2014-01-22 20:21:37

Ace
Member
Registered: 2014-01-21
Posts: 10

Re: Xfce auto start problem

I added an echo command but nothing came out.
I wrote above.
As for your script I didn't copy past to my bash_profile it if thats what you mean.

if lsmod | grep -qw ^nvidia 

I dont have nvidia drivers.

Offline

Board footer

Powered by FluxBB