Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RH & X Question



> But I also want to have the original login to go away.  I want
> something like:
> 
>   startx & ; logout
> 
> But that didn't work when I tried it.  Maybe I did something wrong.
> 
> This is a naive user thing: Login.  Do stuff.  Tell X to logout.  Be
> back where s/he started.  If I just do a startx as part of the login,
> then the user needs to quit X and remember to logout.  I want to get
> rid of that step.

I was browsing around and (looking for somthing completely different) I found
this: 

http://www.linuxgazette.com/issue27/kodis.html

Since I normally use X whenever I'm logged in at the console, I've added the
following few lines of code to my .zlogin and .bash_profile scripts. This code
queries "Start X [Yn]? " when initially logged in from the first virtual
console, and waits 10 seconds for a response. Entering Y or allowing the
timeout to occur results in X being started. On exiting X, a similar timed
query asking "Log out [Yn]? " is issued, giving the option of logging out or
being dropped into a text console. 

case `tty` in 
    /dev/tty[1])
        echo -n "Start X [Yn]? "
        expect \
            -c 'stty raw' \
            -c 'set timeout 10' \
            -c 'expect -nocase n {exit 1} -re . {exit 0}'
        if [ $? = 0 ] ; then
            startx
            echo -n "Log out [Yn]? "
            expect \
                -c 'stty raw' \
                -c 'set timeout 10' \
                -c 'expect -nocase n {exit 1} -re . {exit 0}'
            if [ $? = 0 ] ; then
                logout
            fi
        fi
        echo
    ;;
esac

-- 
~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-., \|/  (___)  \|/ _,.-=~'`^`
                          Brian Medley         @~./'O o`\.~@
"Knowledge is Power" brian.medley at verizon.net /__( \___/ )__\  *PPPFFBT!*
  -- Francis Bacon                               `\__`U_/'
 _,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~= <____|'  ^^`'~=-.,__,.-=
~`'^`'~=-.,__,.-=~'`^`'~=-.,__,.-=~'`^`'~=-.,__,.-==--^'~=-.,__,.-=~'`^`
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org