X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=grml-x;h=243951d931a5a4131aa72defd9ff3c14b10f6073;hb=d7f62d308aaf026f919addf2ffee1d74c6284cd6;hp=7ea0aa729cbbf342cf38d2f0536a6255286b44c3;hpb=849ff1b991c5b62d8b3483519d236ec24313c4e6;p=grml-x.git diff --git a/grml-x b/grml-x index 7ea0aa7..243951d 100755 --- a/grml-x +++ b/grml-x @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mon Mär 26 21:26:31 CEST 2007 [mika] +# Latest change: Mon Mär 26 22:19:37 CEST 2007 [mika] ################################################################################ # debugging {{{ @@ -21,15 +21,16 @@ [ -r /etc/grml_colors ] && . /etc/grml_colors fi - # some functions like getbootparam - if [ -r /etc/grml/script-functions ] ; then + # some functions like getBootParam + if [ -r /etc/grml/script-functions -a -r /etc/grml/sh-lib ] ; then source /etc/grml/script-functions + source /etc/grml/sh-lib else - echo 'Error: sourcing /etc/grml/script-functions failed. Exiting.' + echo 'Error: sourcing function files failed. Exiting.' exit 1 fi - check4root && ROOT='1' || ROOT='' + check4root &>/dev/null && ROOT='1' || ROOT='' # }}} # set variables {{{ @@ -383,7 +384,7 @@ parse_options() fi if [[ "$o_fallback" != "" ]]; then - SKIPHWINFO="yes" + FALLBACK="yes" if [ -r /etc/X11/xorg.conf.example ] ; then sudo cp /etc/X11/xorg.conf.example $XCONFIG print "$bold_color$fg[blue]Copying /etc/X11/xorg.conf.example to $XCONFIG as requested via fallback option." @@ -442,7 +443,7 @@ parse_options() Option \"XkbVariant\" \"nodeadkeys\"" fi - if [ -n "$FORCE" -o ! -r "$XCONFIG" -o -n "$SKIPHWINFO" ] ; then + if [ -n "$FORCE" -o ! -r "$XCONFIG" -a -z "$FALLBACK" ] ; then print -n "$bold_color$fg[blue]Gathering hardware information...$fg[red]" sync # get hsync/vsync @@ -490,7 +491,7 @@ parse_options() # module handling MODULE=$o_module[2] if [ -z "$MODULE" ] ; then - MODULE="$(getbootparam xmodule 2>/dev/null)" + MODULE="$(getBootParam xmodule 2>/dev/null)" if [ -z "$MODULE" ] ; then MODULE=$(grep 'XFree86 v4 Server Module:' "${HWINFO_TMP}" | head -1 | awk '{print $5}') if [ -z "$MODULE" ] ; then @@ -510,7 +511,7 @@ parse_options() MODE=$o_mode[2] if [ -z $MODE ] ; then - B_MODE="$(getbootparam xmode 2>/dev/null)" + B_MODE="$(getBootParam xmode 2>/dev/null)" if [ -n "$B_MODE" ] ; then MODES="Modes \"$B_MODE\"" FORCE="yes" @@ -758,7 +759,7 @@ function writeconfig print -n "$bold_color$fg[blue]Creating $XCONFIG: $fg[red]" writeit && print "$fg[green]done$reset_color" else - if [ -z "$FORCE" ] ; then + if [ -z "$FORCE" -a -z "$FALLBACK" ] ; then print "$bold_color$fg[blue]Notice: $XCONFIG exists already. Use the force-option (-force) to force creation. $fg[red]" @@ -788,10 +789,10 @@ function runit print "" if [ -z "$DISPLAY" ] ; then print "$bold_color$fg[green]Now trying to run startx.$reset_color" - startx ~/.xinitrc -- $XOPTS + startx $XINITRC -- $XOPTS else print "$bold_color$fg[green]Now trying to run startx on display $DISPLAY.$reset_color" - startx ~/.xinitrc -- :$DISPLAY $XOPTS + startx $XINITRC -- :$DISPLAY $XOPTS fi else print "$bold_color$fg[blue]Not running startx as requested via option.$reset_color" @@ -873,6 +874,10 @@ cleanup # }}} # xinitrc {{{ + if ! [ -x "$(which $WINDOWMANAGER)" ] ; then + print "$bg[black]$fg[red]${bold_color}Fatal: windowmanager $fg[blue]$WINDOWMANAGER$fg[red] not executable, startx won' work.${reset_color}">&2 + bailout + fi if [ -w "$XINITRC" ] ; then sed -i "s|^[^#]*exec.*| exec $WINDOWMANAGER|g" $XINITRC runit || failed