LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   automatically starting gui after login (https://www.linuxquestions.org/questions/slackware-14/automatically-starting-gui-after-login-346640/)

marsques 07-25-2005 02:22 PM

automatically starting gui after login
 
instead of editing the innit file is it possibe to automatically load the GUI for a particular user instead of for everyone... i mean once they enter their login name and password in console for the GUI to load up instead of them having to mess around in the console...

thank you...

huibert.alblas 07-25-2005 02:30 PM

maybe put "startx &" in .bashrc

Or for all users pput it into /etc/bash.bashrc

leonscape 07-25-2005 02:32 PM

You could simply add the line startx to either their .bash_profile or to /etc/profile, I just tried it in /etc/profile and it worked like a charm.

marsques 07-25-2005 02:37 PM

thank you, i'll give it a try...

marsques 07-25-2005 03:01 PM

thanks, it worked (used the bash_profile route)

egag 07-25-2005 03:33 PM

if you add it to /etc/profile, you cannot login to a normal console without starting X.
so .bash_profile or .profile in the home dir. is better.

egag

phil.d.g 07-25-2005 03:53 PM

Doesn't that also try and start X when opening an xterm aswell, or at least it did when I tried that. You could do with a bit of checking before executing `startx`, something of the lines
Code:

#!/bin/bash
for i in 0 1 2 3 4 5 6
do
    if [ `tty` = "/dev/tty$i" ]
    then
        startx
        exit
    fi
done

You could even check X isn't running to start off with, but the above always met my needs

egag 07-25-2005 04:11 PM

you're right.

but maybe testing with " ps -aux |grep X " is simpler.

edit: EDIT: you will still start a second X with ctrl-alt-F6, and then login

egag

phil.d.g 07-25-2005 04:30 PM

yes true, I did think of this whilst writing it down here, but when I had X running I never felt the need to go to another ttyX console when I could open up another xterm. So it worked perfectly OK for my needs

marsques 07-25-2005 06:38 PM

yeah i noticed that as well, when openning konsole/xterm/etc i get some sort of message saying X is already running when the GUI is loaded automatically through .bash_profile...


All times are GMT -5. The time now is 04:02 PM.