Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37881487
en ru br
Репозитории ALT
5.1: 3.5.10-alt20.M51.2
4.1: 3.5.10-alt16.M41.1
4.0: 3.5.9-alt1.M40.1
3.0: 3.4.1-alt12
+updates:3.4.1-alt12.1.M30
+backports:3.5.6-alt7.0.M30
www.altlinux.org/Changes

Группа :: Графические оболочки/KDE
Пакет: kdebase

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: kdebase-3.5-alt-startkde.patch
Скачать


--- kdebase-3.5.10/startkde~	2010-02-25 20:17:26.000000000 +0300
+++ kdebase-3.5.10/startkde	2010-03-16 18:00:01.000000000 +0300
@@ -3,6 +3,24 @@
 #  DEFAULT KDE STARTUP SCRIPT ( KDE-3.5.10 )
 #
 
+SourceIfNotEmpty()
+{
+    local f="$1"
+    shift
+    [ -s "$f" ] && . "$f" "$@"
+}
+
+ExecIfExecutable()
+{
+    local f="$1"
+    shift
+    [ -x "$f" ] && "$f" "$@"
+}
+
+Quote(){ echo "$@" |sed -e 's/[\&;()<>!|{}?*`"'\''[:space:]]/\\&/g' || return 1; }
+
+ReadConfig(){ eval echo $(Quote $($KDEDIR/bin/kreadconfig --file "$1" --group "$2" --key "$3" --default "$4")); }
+
 # When the X server dies we get a HUP signal from xinit. We must ignore it
 # because we still need to do some cleanup.
 trap 'echo GOT SIGHUP' HUP
@@ -10,7 +28,7 @@ trap 'echo GOT SIGHUP' HUP
 # Check if a KDE session already is running
 if kcheckrunning >/dev/null 2>&1; then
 	echo "KDE seems to be already running on this display."
-	xmessage -geometry 500x100 "KDE seems to be already running on this display." > /dev/null 2>/dev/null
+	xmessage -center "KDE seems to be already running on this display." > /dev/null 2>/dev/null
 	exit 1
 fi
 
@@ -18,20 +36,10 @@ fi
 # The standard X background is nasty, causing moire effects and exploding
 # people's heads. We use colours from the standard KDE palette for those with
 # palettised displays.
+SourceIfNotEmpty /usr/share/design-current/config
+[ -n "$BACKGROUND_COLOR" ] || BACKGROUND_COLOR="000000"
 if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then
-  xsetroot -solid "#000000"
-fi
-
-# we have to unset this for Darwin since it will screw up KDE's dynamic-loading
-unset DYLD_FORCE_FLAT_NAMESPACE
-
-# in case we have been started with full pathname spec without being in PATH
-bindir=`echo "$0" | sed -n 's,^\(/.*\)/[^/][^/]*$,\1,p'`
-if [ -n "$bindir" ]; then
-  case $PATH in
-    $bindir|$bindir:*|*:$bindir|*:$bindir:*) ;;
-    *) PATH=$bindir:$PATH; export PATH;;
-  esac
+  xsetroot -solid "#$BACKGROUND_COLOR"
 fi
 
 # Boot sequence:
@@ -48,17 +56,29 @@ fi
 #
 # * Then ksmserver is started which takes control of the rest of the startup sequence
 
+#[ -n "$XDG_CONFIG_DIRS" ] || export XDG_CONFIG_DIRS=/etc/xdg
+[ -n "$XDG_DATA_DIRS" ] || export XDG_DATA_DIRS=/usr/share:/var/cache
+
 # The user's personal KDE directory is usually ~/.kde, but this setting
 # may be overridden by setting KDEHOME.
 
-kdehome=$HOME/.kde
+[ -z "$KDEDIR" ] && KDEDIR=/usr
+export KDEDIR
+
+kdehome="$HOME"/.kde
 test -n "$KDEHOME" && kdehome=`echo "$KDEHOME"|sed "s,^~/,$HOME/,"`
+export KDEROOTHOME="/root"
+
+KDELANG=`echo $LANG|sed "s/_.*//"`
+[ -z "$KDE_ALT_DATA" ] && KDE_ALT_DATA=/usr/share/kde
+DESK_SKEL=$KDEDIR/share/apps/kdesktop/DesktopLinks
+CONF_SKEL=$KDE_ALT_DATA/userconfig
 
 # see kstartupconfig source for usage
-mkdir -m 700 -p $kdehome
-mkdir -m 700 -p $kdehome/share
-mkdir -m 700 -p $kdehome/share/config
-cat >$kdehome/share/config/startupconfigkeys <<EOF
+mkdir -m 700 -p "$kdehome"
+mkdir -m 700 -p "$kdehome/share"
+mkdir -m 700 -p "$kdehome/share/config"
+cat >"$kdehome/share/config/startupconfigkeys" <<EOF
 kcminputrc Mouse cursorTheme ''
 kcminputrc Mouse cursorSize ''
 kpersonalizerrc General FirstLogin true
@@ -72,9 +92,9 @@ kcmfonts General forceFontDPI 0
 EOF
 kstartupconfig
 if test $? -ne 0; then
-    xmessage -geometry 500x100 "Could not start kstartupconfig. Check your installation."
+    xmessage -center "Could not start kstartupconfig. Check your installation."
 fi
-. $kdehome/share/config/startupconfig
+. "$kdehome/share/config/startupconfig"
 
 # XCursor mouse theme needs to be applied here to work even for kded or ksmserver
 if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
@@ -180,72 +200,6 @@ for prefix in `echo "$exepath" | sed -n
   done
 done
 
-# Activate the kde font directories.
-#
-# There are 4 directories that may be used for supplying fonts for KDE.
-#
-# There are two system directories. These belong to the administrator.
-# There are two user directories, where the user may add her own fonts.
-#
-# The 'override' versions are for fonts that should come first in the list,
-# i.e. if you have a font in your 'override' directory, it will be used in
-# preference to any other.
-#
-# The preference order looks like this:
-# user override, system override, X, user, system
-#
-# Where X is the original font database that was set up before this script
-# runs.
-
-usr_odir=$HOME/.fonts/kde-override
-usr_fdir=$HOME/.fonts
-
-# Add any user-installed font directories to the X font path
-kde_fontpaths=$usr_fdir/fontpaths
-do_usr_fdir=1
-do_usr_odir=1
-if test -r "$kde_fontpaths" ; then
-    savifs=$IFS
-    IFS="
-"
-    for fpath in `grep -v '^[ 	]*#' < "$kde_fontpaths"` ; do
-        rfpath=`echo $fpath | sed "s:^~:$HOME:g"`
-        if test -s "$rfpath"/fonts.dir; then
-            xset fp+ "$rfpath"
-            if test "$rfpath" = "$usr_fdir"; then
-                do_usr_fdir=0
-            fi
-            if test "$rfpath" = "$usr_odir"; then
-                do_usr_odir=0
-            fi
-        fi
-    done
-    IFS=$savifs
-fi
-
-if test -n "$KDEDIRS"; then
-  kdedirs_first=`echo "$KDEDIRS"|sed -e 's/:.*//'`
-  sys_odir=$kdedirs_first/share/fonts/override
-  sys_fdir=$kdedirs_first/share/fonts
-else
-  sys_odir=$KDEDIR/share/fonts/override
-  sys_fdir=$KDEDIR/share/fonts
-fi
-
-# We run mkfontdir on the user's font dirs (if we have permission) to pick
-# up any new fonts they may have installed. If mkfontdir fails, we still
-# add the user's dirs to the font path, as they might simply have been made
-# read-only by the administrator, for whatever reason.
-
-# Only do usr_fdir and usr_odir if they are *not* listed in fontpaths
-test -d "$sys_odir" && xset +fp "$sys_odir"
-test $do_usr_odir -eq 1 && test -d "$usr_odir" && (mkfontdir "$usr_odir" ; xset +fp "$usr_odir")
-test $do_usr_fdir -eq 1 && test -d "$usr_fdir" && (mkfontdir "$usr_fdir" ; xset fp+ "$usr_fdir")
-test -d "$sys_fdir" && xset fp+ "$sys_fdir"
-
-# Ask X11 to rebuild its font list.
-xset fp rehash
-
 # Set a left cursor instead of the standard X11 "X" cursor, since I've heard
 # from some users that they're confused and don't know what to do. This is
 # especially necessary on slow machines, where starting KDE takes one or two
@@ -256,6 +210,74 @@ xset fp rehash
 #
 xsetroot -cursor_name left_ptr
 
+# create necessary directories/files
+mkdir -p "$kdehome/share/config"
+
+if ! [ -e "$HOME"/.smb/smb.conf ]; then
+    mkdir -p "$HOME"/.smb
+    >"$HOME"/.smb/smb.conf
+    if [ "$KDELANG" == "ru" -o "$KDELANG" == "uk" -o  "$KDELANG" == "be" ]
+    then
+	cat >"$HOME"/.smb/smb.conf <<__EOF__
+# added by startkde
+[global]
+dos charset = CP866
+__EOF__
+    fi
+fi
+
+if ! [ -x $KDEDIR/bin/kreadconfig ]
+then 
+    xmessage -center "Could not execute $KDEDIR/bin/kreadconfig. Check installation of kdebase package."
+    exit 1
+fi
+
+HOME_DESKTOP=`ReadConfig kdeglobals Paths Desktop "$HOME/Desktop"`
+
+if [ ! -d "$kdehome" -a -d $CONF_SKEL/.kde ]; then
+    ( cd $CONF_SKEL/.kde && tar cpf - .kde ) | ( cd "$kdehome" && tar xpf - )
+fi
+
+if [ ! -e "$kdehome"/share/config/emaildefaults ]; then
+    $KDEDIR/bin/mailsettings >"$kdehome"/share/config/emaildefaults
+fi
+
+if [ ! -e "$kdehome"/share/config/kmailrc ]; then
+    cat >"$kdehome"/share/config/kmailrc <<__EOF__
+[General]
+transports=1
+[Transport 1]
+host=/usr/sbin/sendmail
+name=Sendmail
+type=sendmail
+__EOF__
+fi
+
+if [ ! -f "$HOME"/.kderc -a -e $CONF_SKEL/.kderc ]; then
+    cp $CONF_SKEL/.kderc "$HOME"
+    chmod 0600 "$HOME"/.kderc
+fi
+
+HOME_AUTOSTART=`ReadConfig kdeglobals Paths Autostart "$kdehome/Autostart"`
+mkdir -p "$HOME_AUTOSTART"
+
+if [ ! -d "$kdehome/share/apps/konqueror" ] ; then
+    mkdir -p "$kdehome/share/apps/konqueror/"
+    # Install bookmarks
+    for bookmarksfile in \
+	    "/etc/kde/distribution/share/kde/bookmarks-$KDELANG.xml" \
+	    "/etc/kde/distribution/share/kde/bookmarks.xml" \
+	    "$KDE_ALT_DATA/bookmarks-$KDELANG.xml" \
+	    "$KDE_ALT_DATA/bookmarks.xml"
+    do
+	if [ -f "$bookmarksfile" ]; then
+	    cp "$bookmarksfile" "$kdehome/share/apps/konqueror/bookmarks.xml"
+	    break
+	fi
+    done
+fi
+
+usr_fdir="$HOME"/.fonts
 # Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
 if test -n "$GS_LIB" ; then
     GS_LIB=$usr_fdir:$GS_LIB
@@ -275,7 +297,7 @@ fi
 for resource in tmp cache socket; do
     if ! lnusertemp $resource >/dev/null; then
         echo 'startkde: Call to lnusertemp failed (temporary directories full?). Check your installation.'  1>&2
-        xmessage -geometry 600x100 "Call to lnusertemp failed (temporary directories full?). Check your installation."
+        xmessage -center "Call to lnusertemp failed (temporary directories full?). Check your installation."
         exit 1
     fi
 done
@@ -286,7 +308,7 @@ dcopserver_shutdown
 echo 'startkde: Starting up...'  1>&2
 
 # run KPersonalizer before the session, if this is the first login
-if test "$kpersonalizerrc_general_firstlogin" = "true"; then
+if false ; then
     # start only dcopserver, don't start whole kdeinit (takes too long)
     echo 'startkde: Running kpersonalizer...'  1>&2
     dcopserver
@@ -346,7 +368,7 @@ LD_BIND_NOW=true start_kdeinit_wrapper -
 if test $? -ne 0; then
   # Startup error
   echo 'startkde: Could not start kdeinit. Check your installation.'  1>&2
-  xmessage -geometry 500x100 "Could not start kdeinit. Check your installation."
+  xmessage -center "Could not start kdeinit. Check your installation."
 fi
 
 # If the session should be locked from the start (locked autologin),
@@ -373,12 +395,12 @@ kwrapper ksmserver $KDEWM
 if test $? -eq 255; then
   # Startup error
   echo 'startkde: Could not start ksmserver. Check your installation.'  1>&2
-  xmessage -geometry 500x100 "Could not start ksmserver. Check your installation."
+  xmessage -center "Could not start ksmserver. Check your installation."
 fi
 
 # wait if there's any crashhandler shown
 while dcop | grep -q ^drkonqi- ; do
-    sleep 5
+    sleep 3
 done
 
 echo 'startkde: Shutting down...'  1>&2
@@ -388,7 +410,8 @@ kdeinit_shutdown
 dcopserver_shutdown --wait
 artsshell -q terminate
 # KDE4 support
-kde4 kdeinit4_shutdown 2>/dev/null
+KDE4WRAPPER=`which kde4 2>/dev/null`
+[ -z "$KDE4WRAPPER" ] || $KDE4WRAPPER kdeinit4_shutdown 2>/dev/null
 
 echo 'startkde: Running shutdown scripts...'  1>&2
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin