You are not logged in.

#1 2011-02-15 16:05:25

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Is it a good method to run Fluxbox?

Sorry if the question is nooby...

My startx script:

#!/bin/sh

#
# This is just a sample implementation of a slightly less primitive
# interface than xinit.  It looks for user .xinitrc and .xserverrc
# files, then system xinitrc and xserverrc files, else lets xinit choose
# its default.  The system xinitrc should probably do things like check
# for .Xresources files and merge them in, startup up a window manager,
# and pop a clock and serveral xterms.
#
# Site administrators are STRONGLY urged to write nicer versions.
#

unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER


userclientrc=$HOME/.xinitrc
sysclientrc=/etc/X11/xinit/xinitrc


userserverrc=$HOME/.xserverrc
sysserverrc=/etc/X11/xinit/xserverrc
defaultclient=xterm
defaultserver=/usr/bin/X
defaultclientargs=""
defaultserverargs=""
defaultdisplay=":0"
clientargs=""
serverargs=""

enable_xauth=1



whoseargs="client"
while [ x"$1" != x ]; do
    case "$1" in
    # '' required to prevent cpp from treating "/*" as a C comment.
    /''*|\./''*)
    if [ "$whoseargs" = "client" ]; then
        if [ x"$client" = x ] && [ x"$clientargs" = x ]; then
        client="$1"
        else
        clientargs="$clientargs $1"
        fi
    else
        if [ x"$server" = x ] && [ x"$serverargs" = x ]; then
        server="$1"
        else
        serverargs="$serverargs $1"
        fi
    fi
    ;;
    --)
    whoseargs="server"
    ;;
    *)
    if [ "$whoseargs" = "client" ]; then
        clientargs="$clientargs $1"
    else
        # display must be the FIRST server argument
        if [ x"$serverargs" = x ] && \
         expr "$1" : ':[0-9][0-9]*$' > /dev/null 2>&1; then
        display="$1"
        else
        serverargs="$serverargs $1"
        fi
    fi
    ;;
    esac
    shift
done

# process client arguments
if [ x"$client" = x ]; then
    client=$defaultclient

    # if no client arguments either, use rc file instead
    if [ x"$clientargs" = x ]; then
        if [ -f "$userclientrc" ]; then
            client=$userclientrc
        elif [ -f "$sysclientrc" ]; then
            client=$sysclientrc






        fi

        clientargs=$defaultclientargs
    fi
fi

# process server arguments
if [ x"$server" = x ]; then
    server=$defaultserver

    # if no server arguments or display either, use defaults
    if [ x"$serverargs" = x -a x"$display" = x ]; then
    # For compatibility reasons, only use xserverrc if there were no server command line arguments
    if [ -f "$userserverrc" ]; then
        server=$userserverrc
    elif [ -f "$sysserverrc" ]; then
        server=$sysserverrc
    fi

    serverargs=$defaultserverargs
    display=$defaultdisplay
    fi
fi

if [ x"$enable_xauth" = x1 ] ; then
    if [ x"$XAUTHORITY" = x ]; then
        XAUTHORITY=$HOME/.Xauthority
        export XAUTHORITY
    fi

    removelist=

    # set up default Xauth info for this machine
    case `uname` in
    Linux*)
        if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then
            hostname=`hostname -f`
        else
            hostname=`hostname`
        fi
        ;;
    *)
        hostname=`hostname`
        ;;
    esac

    authdisplay=${display:-:0}

    mcookie=`/usr/bin/mcookie`







    if test x"$mcookie" = x; then
        echo "Couldn't create cookie"
        exit 1
    fi
    dummy=0

    # create a file with auth information for the server. ':0' is a dummy.
    xserverauthfile=`mktemp -p /tmp serverauth.XXXXXXXXXX`
    trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM
    xauth -q -f "$xserverauthfile" << EOF
add :$dummy . $mcookie
EOF

    serverargs=${serverargs}" -auth "${xserverauthfile}


    # now add the same credentials to the client authority file
    # if '$displayname' already exists do not overwrite it as another
    # server man need it. Add them to the '$xserverauthfile' instead.
    for displayname in $authdisplay $hostname$authdisplay; do
        authcookie=`xauth list "$displayname" \
        | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null;
        if [ "z${authcookie}" = "z" ] ; then
            xauth -q << EOF 
add $displayname . $mcookie
EOF
        removelist="$displayname $removelist"
        else
            dummy=$(($dummy+1));
            xauth -q -f "$xserverauthfile" << EOF
add :$dummy . $authcookie
EOF
        fi
    done
fi

xinit "$client" $clientargs -- "$server" $display $serverargs

retval=$?

if [ x"$enable_xauth" = x1 ] ; then
    if [ x"$removelist" != x ]; then
        xauth remove $removelist
    fi
    if [ x"$xserverauthfile" != x ]; then
        rm -f "$xserverauthfile"
    fi
fi



exit $retval

It's default after Arch installation. Then I do

echo 'startfluxbox' > ~/.xinitrc

(it's empty anyway) and start Fluxbox by doing "startx" in CLI after login (no DE or WM is running).

Is this method normal or not? I don't wanna run Fluxbox automatically 'cause I have 2 users in the system and don't want to use kdm or gdm.

Offline

#2 2011-02-15 16:33:57

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Is it a good method to run Fluxbox?

echo 'exec startfluxbox' > ~/.xinitrc

even better:

echo 'exec ck-launch-session dbus-launch --sh-syntax --exit-with-session startfluxbox' > ~/.xinitrc

and to start X:

startx -nolisten tcp

PS: be sure you have dbus and consolekit installed. smile

Last edited by JokerBoy (2011-02-15 16:34:43)

Offline

#3 2011-02-15 16:54:31

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Is it a good method to run Fluxbox?

Thanks. What does "-nolisten tcp" do? Can't find in Google...

Offline

#4 2011-02-15 17:13:20

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: Is it a good method to run Fluxbox?

first page on google
http://lists.meego.com/pipermail/meego- … 04705.html

second
http://nst.sourceforge.net/nst/docs/faq/ch08s06.html

Last edited by JokerBoy (2011-02-15 17:15:09)

Offline

#5 2011-02-15 20:47:25

metzengerstein
Member
Registered: 2010-06-04
Posts: 60

Re: Is it a good method to run Fluxbox?

@MR. Alex
You should stick with JokerBoys suggestion ONLY if you need its implied functionality. Most likely you won't need it and use 'exec XYZ' (exec to replace the current shell with the command). The rest is stated in the wiki.
And nolisten-tcp is the default behavior.

Also please mark your thread [SOLVED] when you've found the answers.

Offline

#6 2011-02-16 00:15:51

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Is it a good method to run Fluxbox?

metzengerstein wrote:

@MR. Alex
You should stick with JokerBoys suggestion ONLY if you need its implied functionality. Most likely you won't need it..

I disagree. I wager he will be needing both consolekit and dbus.

Offline

Board footer

Powered by FluxBB