By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 675
Collapse All | Expand All

(-)startkde (-176 / +287 lines)
Lines 1-30 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
#  DEFAULT TRINITY STARTUP SCRIPT ( KDE-3.5.12 )
3
#  DEFAULT TRINITY STARTUP SCRIPT ( KDE-3.5.13 )
4
#
4
#
5
5
6
echo "[startkde] Starting startkde." 1>&2
6
echo "[startkde] Starting startkde." 1>&2
7
echo "[startkde] This script is $0" 1>&2
8
9
# Avoid any possible conflict with KDE4. Use full path names to binaries within
10
# this script. The binaries for TDE are located in the same place as this script.
11
# To determine that location use this method rather than $KDEDIR in case that
12
# variable is not defined or defined to point to KDE4 binaries.
13
BIN_DIR="`dirname $0`"
14
# Do not use kde-config to determine the version. That command creates a profile
15
# directory in the root of the file system. Refer to Bug Report 293.
16
KDE_VERSION="`$BIN_DIR/konqueror --version | grep KDE | awk '{print $2}'`"
17
echo "[startkde] TDE version is $KDE_VERSION" 1>&2
18
KDEDIR=`echo $BIN_DIR | sed 's|/bin||'`
19
echo "[startkde] TDE base directory is $KDEDIR" 1>&2
20
unset BIN_DIR
7
21
8
# When the X server dies we get a HUP signal from xinit. We must ignore it
22
# When the X server dies we get a HUP signal from xinit. We must ignore it
9
# because we still need to do some cleanup.
23
# because we still need to do some cleanup.
10
trap '[startkde] echo GOT SIGHUP' HUP
24
trap '[startkde] echo GOT SIGHUP' HUP
11
25
12
# Check if a KDE session is already running.
26
# Check if a TDE session is already running.
13
if kcheckrunning >/dev/null 2>&1; then
27
if kcheckrunning >/dev/null 2>&1; then
14
	echo "[startkde] KDE seems to be already running on this display."
28
	echo "[startkde] TDE seems to be already running on this display."
15
	xmessage -geometry 500x100 "KDE seems to be already running on this display." > /dev/null 2>/dev/null
29
	xmessage -geometry 500x100 "TDE seems to be already running on this display." > /dev/null 2>/dev/null
16
	exit 1
30
  exit 1
17
fi
31
fi
18
32
19
# Set the background color.
33
# Set the background color.
20
# The standard X background is nasty, causing moire effects and exploding
34
# The standard X background is nasty, causing moire effects and exploding
21
# people's heads. We use colours from the standard KDE palette for those with
35
# people's heads. We use colours from the standard TDE palette for those with
22
# palettised displays.
36
# palettised displays.
23
if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then
37
if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then
24
  xsetroot -solid "#618DCC" # sky blue
38
  xsetroot -solid "#618DCC" # sky blue
25
fi
39
fi
26
40
27
# Unset this for Darwin since it will screw up KDE's dynamic-loading
41
# Unset this for Darwin since it will screw up TDE's dynamic-loading
28
unset DYLD_FORCE_FLAT_NAMESPACE
42
unset DYLD_FORCE_FLAT_NAMESPACE
29
43
30
# Check whether prelinking is enabled. If so, exporting KDE_IS_PRELINKED improves
44
# Check whether prelinking is enabled. If so, exporting KDE_IS_PRELINKED improves
Lines 62-74 Link Here
62
#
76
#
63
# * Then ksmserver is started which takes control of the rest of the startup sequence
77
# * Then ksmserver is started which takes control of the rest of the startup sequence
64
78
65
# The user's personal KDE directory usually is $HOME/.kde or $HOME/.trinity.
79
# The user's personal TDE directory usually is $HOME/.trinity.
66
# This setting may be overridden by setting $KDEHOME.
80
# This setting may be overridden by setting $KDEHOME. When migrating profiles
67
# Must be careful here because $HOME/.kde was used commonly in the pre-KDE4
81
# must be careful here because $HOME/.kde was used commonly in the pre-KDE4
68
# days for the user's KDE3 profile, but now with KDE4 common on systems,
82
# days for the user's TDE profile, but now with KDE4 common on systems,
69
# $HOME/.kde might point to KDE4 profile settings. Further, the existence
83
# $HOME/.kde might point to KDE4 profile settings. The existence of KDE4
70
# of KDE4 does not mean all people have KDE4 installed and might want to keep
84
# does not mean all people are using KDE4.
71
# $HOME/.kde as their preferred profile location for Trinity KDE.
72
85
73
if [ -n "$KDEHOME" ]; then
86
if [ -n "$KDEHOME" ]; then
74
  echo "[startkde] KDEHOME is preset to $KDEHOME." 1>&2
87
  echo "[startkde] KDEHOME is preset to $KDEHOME." 1>&2
Lines 76-90 Link Here
76
else
89
else
77
  # $KDEHOME is NOT already preset in the environment. Try to help.
90
  # $KDEHOME is NOT already preset in the environment. Try to help.
78
  # This might be overkill but does provide flexibility.
91
  # This might be overkill but does provide flexibility.
92
  # This script and kstandardirs.h and kstandardirs.cpp must match.
93
  # The latter two must be edited/patched before compiling.
79
  echo "[startkde] KDEHOME is not set." 1>&2
94
  echo "[startkde] KDEHOME is not set." 1>&2
80
  if [ -d $HOME/.trinity ]; then
95
  if [ -d $HOME/.trinity ]; then
81
    # OK, this one is obvious.
96
    # OK, this one is obvious.
82
    export KDEHOME=$HOME/.trinity
97
    export KDEHOME=$HOME/.trinity
83
  elif [ -d $HOME/.trinity ]; then
84
    # Looks like the user had an old version of Trinity installed at last login
85
    echo "[startkde] Migrating old ~/.trinity directory to new ~/.trinity name." 1>&2
86
    mv $HOME/.trinity $HOME/.trinity
87
    export KDEHOME=$HOME/.trinity
88
  elif [ -f /usr/bin/kde4-config ]; then
98
  elif [ -f /usr/bin/kde4-config ]; then
89
    # Looks like KDE4 is installed.
99
    # Looks like KDE4 is installed.
90
    if [ -d $HOME/.kde ] && [ ! -d $HOME/.trinity ]; then
100
    if [ -d $HOME/.kde ] && [ ! -d $HOME/.trinity ]; then
Lines 95-107 Link Here
95
      export KDEHOME=$HOME/.trinity
105
      export KDEHOME=$HOME/.trinity
96
    fi
106
    fi
97
  elif [ -f /opt/trinity/bin/kde-config ]; then
107
  elif [ -f /opt/trinity/bin/kde-config ]; then
98
    # Looks like KDE3 or Trinity is installed and playing second fiddle to KDE4.
108
    # Looks like Trinity is installed.
99
    export KDEHOME=$HOME/.trinity
100
  elif [ -f /opt/trinity/bin/kde-config ]; then
101
    # Looks like KDE3 or Trinity is installed and playing second fiddle to KDE4.
102
    export KDEHOME=$HOME/.trinity
109
    export KDEHOME=$HOME/.trinity
103
  elif [ -f /usr/bin/kde-config ] && [ -d $HOME/.kde ]; then
110
  elif [ -f /usr/bin/kde-config ] && [ -d $HOME/.kde ]; then
104
    # Looks like KDE3 or Trinity is installed and not playing second fiddle to KDE4.
111
    # Looks like Trinity is installed and not playing second fiddle to KDE4.
105
    export KDEHOME=$HOME/.kde
112
    export KDEHOME=$HOME/.kde
106
  else
113
  else
107
    # Resort to this and hope for the best!
114
    # Resort to this and hope for the best!
Lines 110-115 Link Here
110
  echo "[startkde] Set KDEHOME to $KDEHOME." 1>&2
117
  echo "[startkde] Set KDEHOME to $KDEHOME." 1>&2
111
fi
118
fi
112
119
120
# This is a modest attempt to migrate a KDE3 profile to Trinity.
121
# If $HOME/.trinity exists then skip this one-time migration.
122
# Can we make this section more robust?
123
if [ -d "$HOME/.trinity" ]; then
124
  echo "[startkde] $HOME/.trinity exists." 1>&2
125
else
126
  echo "[startkde] $HOME/.trinity does not exist." 1>&2
127
  if [ -d "$HOME/.kde3" ]; then
128
    # If $HOME/.kde3 exists, probably safe to presume a profile from KDE3 or a previous Trinity.
129
    # Go ahead and migrate that profile.
130
    echo "[startkde] Migrating an existing KDE3 profile directory:" 1>&2
131
    echo "[startkde] This is a one-time event." 1>&2
132
    echo "[startkde] Copying \$HOME/.kde3 to \$HOME/.trinity." 1>&2
133
    cp -a $HOME/.kde3 $HOME/.trinity
134
    KDE_OLD_PROFILE=".kde3"
135
  elif [ -d "$HOME/.kde" ]; then
136
    # This is tricky --- ensure this profile directory is NOT KDE4.
137
    if [ ! -d $HOME/.kde/share/kde4 ] && \
138
       [ ! -f $HOME/.kde/share/config/nepomukserverrc ] && \
139
       [ ! -f $HOME/.kde/share/config/phonondevicesrc ] && \
140
       [ ! -f $HOME/.kde/share/config/plasma-desktop-appletsrc ] && \
141
       [ ! -f $HOME/.kde/share/config/specialmailcollectionsrc ]; then
142
        # That was five different tests. Probably not a KDE4 profile. There is a chance
143
        # the user's KDE3 profile got contaminated testing KDE4. If that is the case then
144
      # too bad --- the safe route here is not to migrate. Otherwise if this 3-point
145
      # test passes then migrate the profile.
146
      echo "[startkde] Migrating an existing KDE3 profile directory:" 1>&2
147
      echo "[startkde] This is a one-time event." 1>&2
148
      echo "[startkde] Copying \$HOME/.kde to \$HOME/.trinity." 1>&2
149
      cp -a $HOME/.kde $HOME/.trinity
150
      KDE_OLD_PROFILE=".kde"
151
    fi
152
  else
153
    echo "[startkde] Found no KDE3 profile directory to migrate." 1>&2
154
  fi
155
fi
156
if [ -n "$KDE_OLD_PROFILE" ]; then
157
  # Let's remove any KDE3 "contamination."
158
  echo "[startkde] Removing KDE3 remnants from the new Trinity profile:" 1>&2
159
  echo "[startkde] Removing cache and temp files." 1>&2
160
  rm -fr $HOME/.trinity/cache-*
161
  rm -fr $HOME/.trinity/socket-*
162
  rm -fr $HOME/.trinity/tmp-*
163
  # Need to fix config files.
164
  # Exclude KMail mail files --- we don't want to touch those files.
165
  # I'm using maildir --- do these commands work for mbox too?
166
  echo "[startkde] Cleaning config files (but not KMail mail files. :-))" 1>&2
167
  echo "[startkde] Cleaning, first pass..." 1>&2
168
  find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/${KDE_OLD_PROFILE}|/\.trinity|g" {} \;
169
  if [ "$?" = "0" ]; then
170
    echo "[startkde] Done." 1>&2
171
  else
172
    echo "[startkde] There was an error with the first pass." 1>&2
173
  fi
174
  # What if $KDEDIR is not defined? Bummer.
175
  if [ -z "$KDEDIR" ]; then
176
    echo "[startkde] The \$KDEDIR environment variable does not exist. Can't complete the cleanup." 1>&2
177
  else
178
    echo "[startkde] Cleaning, second pass..." 1>&2
179
    find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/opt/kde3/|${KDEDIR}/|g" {} \;
180
    if [ "$?" = "0" ]; then
181
      echo "[startkde] Done." 1>&2
182
    else
183
      echo "[startkde] There was an error with the second pass." 1>&2
184
    fi
185
    echo "[startkde] Cleaning, third pass..." 1>&2
186
    find $HOME/.trinity -path $HOME/.trinity/share/apps/kmail/mail -prune -o -type f -exec sed -i "s|/usr/share/|${KDEDIR}/share/|g" {} \;
187
    if [ "$?" = "0" ]; then
188
      echo "[startkde] Done." 1>&2
189
    else
190
      echo "[startkde] There was an error with the third pass." 1>&2
191
    fi
192
  fi
193
  # Need to update files in $HOME/.trinity/Autostart.
194
  # Some files might be *.desktop files and can be cleaned in place.
195
  # Some files might be sym links to a previous KDE3 location.
196
  # Recreate those links to the correct Trinity location.
197
  # This needs improvement for apps not in /usr/bin.
198
  echo "[startkde] Attempting to update *.desktop files in Autostart." 1>&2
199
  find $HOME/.trinity/Autostart -! -type l -type f -exec sed -i "s|/usr/bin/|${KDEDIR}/bin/|g" {} \;
200
  echo "[startkde] Attempting to update sym links in Autostart." 1>&2
201
  ( cd $HOME/.trinity/Autostart
202
    for i in `find . -type l`; do
203
      LINK="`readlink $i`"
204
      echo "[startkde] Found a sym link to $LINK." 1>&2
205
      LINK_PATH="`dirname $LINK`"
206
      LINK_NAME="`basename $LINK`"
207
      if [ -n "`echo $LINK_PATH | grep \"/usr\"`" ]; then
208
        echo "[startkde] Sym link points to /usr." 1>&2
209
        NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/usr|${KDEDIR}|\"`"
210
      elif [ -n "`echo $LINK_PATH | grep \"/opt/kde\"`" ]; then
211
        echo "[startkde] Sym link points to /opt/kde." 1>&2
212
        NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/opt/kde|${KDEDIR}|\"`"
213
      elif [ -n "`echo $LINK_PATH | grep \"/opt/kde3\"`" ]; then
214
        echo "[startkde] Sym link points to /opt/kde3." 1>&2
215
        NEW_LINK_PATH="`echo $LINK_PATH | sed \"s|/opt/kde3|${KDEDIR}|\"`"
216
      else
217
        echo "[startkde] Can't establish a path for a new link." 1>&2
218
      fi
219
      unlink $i
220
      echo "[startkde] Attempting to create sym link to $NEW_LINK_PATH/$LINK_NAME." 1>&2
221
      ln -sf $NEW_LINK_PATH/$LINK_NAME $LINK_NAME
222
      if [ "$?" = "0" ]; then
223
        echo "[startkde] Link created." 1>&2
224
      else
225
        echo "[startkde] There was an error with creating the link." 1>&2
226
  fi
227
    done
228
  )
229
  # Quirk: when testing the same user account between a real and virtual machines,
230
  # after a migration KMixer is always muted because the sound devices differ.
231
fi
232
unset KDE_OLD_PROFILE
233
113
# Run a quick test for root.
234
# Run a quick test for root.
114
if [ -z "$KDEROOTHOME" ] && [ "$UID" = "0" ]; then
235
if [ -z "$KDEROOTHOME" ] && [ "$UID" = "0" ]; then
115
  echo "[startkde] User ID is $UID. Setting KDEROOTHOME to $KDEHOME."
236
  echo "[startkde] User ID is $UID. Setting KDEROOTHOME to $KDEHOME."
Lines 118-175 Link Here
118
239
119
# Modify the following environment variables only as necessary.
240
# Modify the following environment variables only as necessary.
120
if [ -d /opt/trinity/games ]; then
241
if [ -d /opt/trinity/games ]; then
121
  export PATH=/opt/trinity/games:$PATH
242
  if [ -z "`echo $PATH | grep \"/opt/trinity/games\"`" ]; then
122
fi
243
    export PATH=/opt/trinity/games:$PATH
123
if [ -d /opt/trinity/bin ]; then
244
  fi
124
  export PATH=/opt/trinity/bin:$PATH
125
fi
126
if [ -d /opt/trinity/games ]; then
127
  export PATH=/opt/trinity/games:$PATH
128
fi
245
fi
129
if [ -d /opt/trinity/bin ]; then
246
if [ -d /opt/trinity/bin ]; then
130
  export PATH=/opt/trinity/bin:$PATH
247
  if [ -z "`echo $PATH | grep \"/opt/trinity/bin\"`" ]; then
131
fi
248
    export PATH=/opt/trinity/bin:$PATH
132
if [ -d /opt/trinity/share ]; then
249
  fi
133
  export XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/trinity/share/:/usr/share/
134
fi
250
fi
135
if [ -d /opt/trinity/share ]; then
251
if [ -d /opt/trinity/share ]; then
136
  export XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/trinity/share/:/usr/share/
252
  if [ -z "`echo $PATH | grep \"/opt/trinity/share\"`" ]; then
137
fi
253
    export XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/trinity/share
138
if [ -d /opt/trinity/etc/xdg ]; then
254
  fi
139
  export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/opt/trinity/etc/xdg/:/etc/xdg/
140
fi
255
fi
141
if [ -d /opt/trinity/etc/xdg ]; then
256
if [ -d /opt/trinity/etc/xdg ]; then
142
  export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/opt/trinity/etc/xdg/:/etc/xdg/
257
  if [ -z "`echo $PATH | grep \"/opt/trinity/etc/xdg\"`" ]; then
143
fi
258
    export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/opt/trinity/etc/xdg
144
if [ -d /opt/trinity/share/man ]; then
145
  export MANPATH=/opt/trinity/share/man:$MANPATH
146
fi
147
if [ -d /opt/trinity/share/man ]; then
148
  export MANPATH=/opt/trinity/share/man:$MANPATH
149
fi
150
if [ -d /opt/trinity ]; then
151
  if [ -n "$KDEDIRS" ]; then
152
    export KDEDIRS=$KDEDIRS:/opt/trinity/:/usr/
153
  else
154
    export KDEDIRS=/opt/trinity/:/usr/
155
  fi
259
  fi
156
fi
260
fi
157
if [ -d /opt/trinity ]; then
261
if [ -d /opt/trinity/share/man ]; then
158
  if [ -n "$KDEDIRS" ]; then
262
  if [ -z "`echo $PATH | grep \"/opt/trinity/share/man\"`" ]; then
159
    export KDEDIRS=$KDEDIRS:/opt/trinity/:/usr/
263
    export MANPATH=/opt/trinity/share/man:$MANPATH
160
  else
161
    export KDEDIRS=/opt/trinity/:/usr/
162
  fi
264
  fi
163
fi
265
fi
266
# if [ -d /opt/trinity ]; then
267
#   if [ -n "$KDEDIRS" ]; then
268
#     export KDEDIRS=$KDEDIRS:/opt/trinity/:/usr/
269
#   else
270
#     export KDEDIRS=/opt/trinity/:/usr/
271
#   fi
272
# fi
164
273
165
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME" | sed "s,^~/,$HOME/,"`
274
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME" | sed "s,^~/,$HOME/,"`
166
echo "[startkde] kdehome: $kdehome" 1>&2
275
# echo "[startkde] kdehome: $kdehome" 1>&2
167
276
168
# Allow interested applications, such as the Plasma control wrapper,
277
# Allow interested applications, such as the Plasma control wrapper,
169
# to know that this is a Trinity desktop and not a KDE one.
278
# to know that this is a Trinity desktop and not a KDE one.
170
export DESKTOP_SESSION=trinity
279
export DESKTOP_SESSION=trinity
171
280
172
# Please see kstartupconfig source for usage.
281
# Please see kstartupconfig source for usage.
282
if [ ! -d "$HOME/.trinity" ]; then
283
  echo "[startkde] Creating $HOME/.trinity." 1>&2
284
fi
173
mkdir -m 700 -p $kdehome
285
mkdir -m 700 -p $kdehome
174
mkdir -m 700 -p $kdehome/share
286
mkdir -m 700 -p $kdehome/share
175
mkdir -m 700 -p $kdehome/share/config
287
mkdir -m 700 -p $kdehome/share/config
Lines 185-191 Link Here
185
kcmrandrrc [Screen3]
297
kcmrandrrc [Screen3]
186
kcmfonts General forceFontDPI 0
298
kcmfonts General forceFontDPI 0
187
EOF
299
EOF
188
kstartupconfig
300
$KDEDIR/bin/kstartupconfig
189
if test $? -ne 0; then
301
if test $? -ne 0; then
190
  xmessage -geometry 500x100 "Could not start kstartupconfig. Check your installation."
302
  xmessage -geometry 500x100 "Could not start kstartupconfig. Check your installation."
191
fi
303
fi
Lines 196-202 Link Here
196
308
197
# Make sure a default wallpaper is set.
309
# Make sure a default wallpaper is set.
198
if [ ! -e $kdehome/share/config/kdesktoprc ]; then
310
if [ ! -e $kdehome/share/config/kdesktoprc ]; then
199
 # With Trinity KDE this file should exist, but test first.
311
 # With Trinity this file should exist, but test first.
200
  if [ -r /usr/share/wallpapers/isadora.png.desktop ]; then
312
  if [ -r /usr/share/wallpapers/isadora.png.desktop ]; then
201
cat >$kdehome/share/config/kdesktoprc <<EOF
313
cat >$kdehome/share/config/kdesktoprc <<EOF
202
[Desktop0]
314
[Desktop0]
Lines 208-291 Link Here
208
320
209
# XCursor mouse theme needs to be applied here to work even for kded or ksmserver.
321
# XCursor mouse theme needs to be applied here to work even for kded or ksmserver.
210
if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
322
if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
211
    kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize"
323
  kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize"
212
    if test $? -eq 10; then
324
  if test $? -eq 10; then
213
        export XCURSOR_THEME=default
325
    export XCURSOR_THEME=default
214
    elif test -n "$kcminputrc_mouse_cursortheme"; then
326
  elif test -n "$kcminputrc_mouse_cursortheme"; then
215
        export XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
327
    export XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
216
    fi
328
  fi
217
    if test -n "$kcminputrc_mouse_cursorsize"; then
329
  if test -n "$kcminputrc_mouse_cursorsize"; then
218
        export XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
330
    export XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
219
    fi
331
  fi
220
fi
332
fi
221
333
222
if test "$kcmrandrrc_display_applyonstartup" = "true"; then
334
if test "$kcmrandrrc_display_applyonstartup" = "true"; then
223
    # 4 screens is hopefully enough
335
  # 4 screens is hopefully enough
224
    for scrn in 0 1 2 3; do
336
  for scrn in 0 1 2 3; do
225
        args=
337
    args=
226
        width="\$kcmrandrrc_screen${scrn}_width" ; eval "width=$width"
338
    width="\$kcmrandrrc_screen${scrn}_width" ; eval "width=$width"
227
        height="\$kcmrandrrc_screen${scrn}_height" ; eval "height=$height"
339
    height="\$kcmrandrrc_screen${scrn}_height" ; eval "height=$height"
228
        if test -n "${width}" -a -n "${height}"; then
340
    if test -n "${width}" -a -n "${height}"; then
229
            args="$args -s ${width}x${height}"
341
      args="$args -s ${width}x${height}"
230
        fi
342
    fi
231
        refresh="\$kcmrandrrc_screen${scrn}_refresh" ; eval "refresh=$refresh"
343
    refresh="\$kcmrandrrc_screen${scrn}_refresh" ; eval "refresh=$refresh"
232
        if test -n "${refresh}"; then
344
    if test -n "${refresh}"; then
233
            args="$args -r ${refresh}"
345
      args="$args -r ${refresh}"
234
        fi
346
    fi
235
        rotation="\$kcmrandrrc_screen${scrn}_rotation" ; eval "rotation=$rotation"
347
    rotation="\$kcmrandrrc_screen${scrn}_rotation" ; eval "rotation=$rotation"
236
        if test -n "${rotation}"; then
348
    if test -n "${rotation}"; then
237
            case "${rotation}" in
349
      case "${rotation}" in
238
                0)
350
        0)
239
                    args="$args -o 0"
351
          args="$args -o 0"
240
                    ;;
352
          ;;
241
                90)
353
        90)
242
                    args="$args -o 1"
354
          args="$args -o 1"
243
                    ;;
355
          ;;
244
                180)
356
        180)
245
                    args="$args -o 2"
357
          args="$args -o 2"
246
                    ;;
358
          ;;
247
                270)
359
        270)
248
                    args="$args -o 3"
360
          args="$args -o 3"
249
                    ;;
361
          ;;
250
            esac
362
      esac
251
        fi
363
    fi
252
        reflectx="\$kcmrandrrc_screen${scrn}_reflectx" ; eval "reflectx=$reflectx"
364
    reflectx="\$kcmrandrrc_screen${scrn}_reflectx" ; eval "reflectx=$reflectx"
253
        if test "${refrectx}" = "true"; then
365
    if test "${refrectx}" = "true"; then
254
            args="$args -x"
366
      args="$args -x"
255
        fi
367
    fi
256
        reflecty="\$kcmrandrrc_screen${scrn}_reflecty" ; eval "reflecty=$reflecty"
368
    reflecty="\$kcmrandrrc_screen${scrn}_reflecty" ; eval "reflecty=$reflecty"
257
        if test "${refrecty}" = "true"; then
369
    if test "${refrecty}" = "true"; then
258
            args="$args -y"
370
      args="$args -y"
259
        fi
371
    fi
260
        if test -n "$args"; then
372
    if test -n "$args"; then
261
            xrandr $args
373
      xrandr $args
262
        fi
374
    fi
263
    done
375
  done
264
fi
376
fi
265
377
266
dl=$DESKTOP_LOCKED
378
dl=$DESKTOP_LOCKED
267
unset DESKTOP_LOCKED # Don't want it in the environment
379
unset DESKTOP_LOCKED # Don't want it in the environment
268
380
269
# Launch splash that doesn't need any KDE libraries here, before
381
# Launch splash that doesn't need any TDE libraries here, before
270
# KDE libraries are loaded into memory (which may take some time
382
# TDE libraries are loaded into memory (which may take some time
271
# with cold caches). Makes the splash appear sooner.
383
# with cold caches). Makes the splash appear sooner.
272
# If kpersonalizer needs to be run splash will be started only later.
384
# If kpersonalizer needs to be run splash will be started only later.
273
if test -z "$dl" && test "$kpersonalizerrc_general_firstlogin" != "true"; then
385
if test -z "$dl" && test "$kpersonalizerrc_general_firstlogin" != "true"; then
274
    case "$ksplashrc_ksplash_theme" in
386
  case "$ksplashrc_ksplash_theme" in
275
      Simple)
387
    Simple)
276
         ksplashsimple
388
      ksplashsimple
277
         ;;
389
      ;;
278
      *)
390
    *)
279
         ;;
391
      ;;
280
    esac
392
  esac
281
fi
393
fi
282
394
283
if test "$kcmfonts_general_forcefontdpi" -eq 120; then
395
if test "$kcmfonts_general_forcefontdpi" -eq 120; then
284
    xrdb -quiet -merge -nocpp <<EOF
396
  xrdb -quiet -merge -nocpp <<EOF
285
Xft.dpi: 120
397
Xft.dpi: 120
286
EOF
398
EOF
287
elif test "$kcmfonts_general_forcefontdpi" -eq 96; then
399
elif test "$kcmfonts_general_forcefontdpi" -eq 96; then
288
    xrdb -quiet -merge -nocpp <<EOF
400
  xrdb -quiet -merge -nocpp <<EOF
289
Xft.dpi: 96
401
Xft.dpi: 96
290
EOF
402
EOF
291
fi
403
fi
Lines 321-330 Link Here
321
fi
433
fi
322
434
323
# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh
435
# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh
324
# (where <localprefix> is $KDEHOME or ~/.trinity, and <prefixes> is where KDE is installed)
436
# (where <localprefix> is $KDEHOME or ~/.trinity, and <prefixes> is where TDE is installed)
325
#
437
#
326
# This is where you can define environment variables that will be available to
438
# This is where you can define environment variables that will be available to
327
# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
439
# all TDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
328
# or eval `gpg-agent --daemon`.
440
# or eval `gpg-agent --daemon`.
329
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
441
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
330
#
442
#
Lines 340-346 Link Here
340
  done
452
  done
341
done
453
done
342
454
343
# Activate the kde font directories.
455
# Activate the TDE font directories.
344
#
456
#
345
# There are 4 directories that may be used for supplying fonts for KDE.
457
# There are 4 directories that may be used for supplying fonts for KDE.
346
#
458
#
Lines 365-386 Link Here
365
do_usr_fdir=1
477
do_usr_fdir=1
366
do_usr_odir=1
478
do_usr_odir=1
367
if test -r "$kde_fontpaths" ; then
479
if test -r "$kde_fontpaths" ; then
368
    savifs=$IFS
480
  savifs=$IFS
369
    IFS="
481
  IFS="
370
"
482
"
371
    for fpath in `grep -v '^[ 	]*#' < "$kde_fontpaths"` ; do
483
  for fpath in `grep -v '^[   ]*#' < "$kde_fontpaths"` ; do
372
        rfpath=`echo $fpath | sed "s:^~:$HOME:g"`
484
    rfpath=`echo $fpath | sed "s:^~:$HOME:g"`
373
        if test -s "$rfpath"/fonts.dir; then
485
    if test -s "$rfpath"/fonts.dir; then
374
            xset fp+ "$rfpath"
486
      xset fp+ "$rfpath"
375
            if test "$rfpath" = "$usr_fdir"; then
487
      if test "$rfpath" = "$usr_fdir"; then
376
                do_usr_fdir=0
488
        do_usr_fdir=0
377
            fi
489
      fi
378
            if test "$rfpath" = "$usr_odir"; then
490
      if test "$rfpath" = "$usr_odir"; then
379
                do_usr_odir=0
491
        do_usr_odir=0
380
            fi
492
      fi
381
        fi
493
    fi
382
    done
494
  done
383
    IFS=$savifs
495
  IFS=$savifs
384
fi
496
fi
385
497
386
if [ ! -n "$KDEDIR" ]; then
498
if [ ! -n "$KDEDIR" ]; then
Lines 438-444 Link Here
438
550
439
# Set a left cursor instead of the standard X11 "X" cursor, since I've heard
551
# Set a left cursor instead of the standard X11 "X" cursor, since I've heard
440
# from some users that they're confused and don't know what to do. This is
552
# from some users that they're confused and don't know what to do. This is
441
# especially necessary on slow machines, where starting KDE takes one or two
553
# especially necessary on slow machines, where starting TDE takes one or two
442
# minutes until anything appears on the screen.
554
# minutes until anything appears on the screen.
443
#
555
#
444
# If the user has overwritten fonts, the cursor font may be different now
556
# If the user has overwritten fonts, the cursor font may be different now
Lines 446-452 Link Here
446
#
558
#
447
xsetroot -cursor_name left_ptr
559
xsetroot -cursor_name left_ptr
448
560
449
# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
561
# Get Ghostscript to look into user's TDE fonts dir for additional Fontmap
450
if test -n "$GS_LIB" ; then
562
if test -n "$GS_LIB" ; then
451
  GS_LIB=$usr_fdir:$GS_LIB
563
  GS_LIB=$usr_fdir:$GS_LIB
452
  export GS_LIB
564
  export GS_LIB
Lines 455-464 Link Here
455
  export GS_LIB
567
  export GS_LIB
456
fi
568
fi
457
569
458
# Link "tmp" "socket" and "cache" resources to directory in /tmp
570
# Link "tmp" "socket" and "cache" resources to directory in $TMP
459
# Creates:
571
# Creates:
460
# - a directory /tmp/kde-$USER and links $KDEHOME/tmp-$HOSTNAME to it.
572
# - a directory $TMP/kde-$USER and links $KDEHOME/tmp-$HOSTNAME to it.
461
# - a directory /tmp/ksocket-$USER and links $KDEHOME/socket-$HOSTNAME to it.
573
# - a directory $TMP/ksocket-$USER and links $KDEHOME/socket-$HOSTNAME to it.
462
# - a directory /var/tmp/kdecache-$USER and links $KDEHOME/cache-$HOSTNAME to it.
574
# - a directory /var/tmp/kdecache-$USER and links $KDEHOME/cache-$HOSTNAME to it.
463
# Note: temporary locations can be overriden through the KDETMP and KDEVARTMP
575
# Note: temporary locations can be overriden through the KDETMP and KDEVARTMP
464
# environment variables.
576
# environment variables.
Lines 471-477 Link Here
471
done
583
done
472
584
473
# In case of dcop sockets left by a previous session, cleanup.
585
# In case of dcop sockets left by a previous session, cleanup.
474
dcopserver_shutdown
586
$KDEDIR/bin/dcopserver_shutdown
475
587
476
echo '[startkde] Starting Trinity...'  1>&2
588
echo '[startkde] Starting Trinity...'  1>&2
477
589
Lines 481-499 Link Here
481
# Run KPersonalizer before the session if this is the first login.
593
# Run KPersonalizer before the session if this is the first login.
482
if test "$kpersonalizerrc_general_firstlogin" = "true"; then
594
if test "$kpersonalizerrc_general_firstlogin" = "true"; then
483
  if [ ! -x $KDEDIR/bin/kpersonalizer ]; then
595
  if [ ! -x $KDEDIR/bin/kpersonalizer ]; then
484
    echo "[startkde] kpersonalizer not found! Please install it in order to properly configure your user profile." 1>&2
596
    echo "[startkde] kpersonalizer not found! Please install in order to properly configure your user profile." 1>&2
485
  else
597
  else
486
    # start only dcopserver, don't start whole kdeinit (takes too long)
598
    # start only dcopserver, don't start whole kdeinit (takes too long)
487
    echo "[startkde] Running kpersonalizer..." 1>&2
599
    echo "[startkde] Running kpersonalizer..." 1>&2
488
    dcopserver
600
    $KDEDIR/bin/dcopserver
489
    kwin --lock &
601
    $KDEDIR/bin/kwin --lock &
490
    kpersonalizer --before-session
602
    $KDEDIR/bin/kpersonalizer --before-session
491
    # handle kpersonalizer restarts (language change)
603
    # handle kpersonalizer restarts (language change)
492
    while test $? -eq 1; do
604
    while test $? -eq 1; do
493
        kpersonalizer --r --before-session
605
      $KDEDIR/bin/kpersonalizer --r --before-session
494
    done
606
    done
495
    dcopquit kwin
607
    $KDEDIR/bin/dcopquit kwin
496
    dcopserver_shutdown --wait
608
    $KDEDIR/bin/dcopserver_shutdown --wait
497
  fi
609
  fi
498
fi
610
fi
499
611
Lines 508-532 Link Here
508
  # the splashscreen and progress indicator
620
  # the splashscreen and progress indicator
509
  case "$ksplashrc_ksplash_theme" in
621
  case "$ksplashrc_ksplash_theme" in
510
    None)
622
    None)
511
       ;; # nothing
623
      ;; # nothing
512
    Simple)
624
    Simple)
513
       if test "$kpersonalizerrc_general_firstlogin" = "true"; then
625
      if test "$kpersonalizerrc_general_firstlogin" = "true"; then
514
           ksplashsimple
626
        $KDEDIR/bin/ksplashsimple
515
       fi # otherwise started earlier
627
      fi # otherwise started earlier
516
       ;;
628
      ;;
517
    *)
629
    *)
518
       ksplash --nodcop
630
      $KDEDIR/bin/ksplash --nodcop
519
       ;;
631
      ;;
520
  esac
632
  esac
521
fi
633
fi
522
634
523
# Mark that full KDE session is running (e.g. Konqueror preloading works only
635
# Mark that full TDE session is running (e.g. Konqueror preloading works only
524
# with full KDE running). The TDE_FULL_SESSION property can be detected by
636
# with full TDE running). The TDE_FULL_SESSION property can be detected by
525
# any X client connected to the same X session, even if not launched
637
# any X client connected to the same X session, even if not launched
526
# directly from the KDE session but e.g. using "ssh -X", kdesu. $TDE_FULL_SESSION
638
# directly from the TDE session but e.g. using "ssh -X", kdesu. $TDE_FULL_SESSION
527
# however guarantees that the application is launched in the same environment
639
# however guarantees that the application is launched in the same environment
528
# like the KDE session and that e.g. KDE utilities/libraries are available.
640
# like the TDE session and that e.g. TDE utilities/libraries are available.
529
# TDE_FULL_SESSION property is also only available since KDE 3.5.5.
530
# The matching tests are:
641
# The matching tests are:
531
#   For $TDE_FULL_SESSION:
642
#   For $TDE_FULL_SESSION:
532
#     if test -n "$TDE_FULL_SESSION"; then ... whatever
643
#     if test -n "$TDE_FULL_SESSION"; then ... whatever
Lines 534-541 Link Here
534
#     xprop -root | grep "^TDE_FULL_SESSION" >/dev/null 2>/dev/null
645
#     xprop -root | grep "^TDE_FULL_SESSION" >/dev/null 2>/dev/null
535
#     if test $? -eq 0; then ... whatever
646
#     if test $? -eq 0; then ... whatever
536
#
647
#
537
# Additionally there is (since KDE 3.5.7) $KDE_SESSION_UID with the uid
648
# Additionally there is $KDE_SESSION_UID with the uid of the user
538
# of the user running the KDE session. It should be rarely needed (e.g.
649
# running the TDE session. It should be rarely needed (for example,
539
# after sudo to prevent desktop-wide functionality in the new user's kded).
650
# after sudo to prevent desktop-wide functionality in the new user's kded).
540
#
651
#
541
TDE_FULL_SESSION=true
652
TDE_FULL_SESSION=true
Lines 548-554 Link Here
548
659
549
# We set LD_BIND_NOW to increase the efficiency of kdeinit.
660
# We set LD_BIND_NOW to increase the efficiency of kdeinit.
550
# kdeinit unsets this variable before loading applications.
661
# kdeinit unsets this variable before loading applications.
551
LD_BIND_NOW=true start_kdeinit_wrapper --new-startup +kcminit_startup
662
LD_BIND_NOW=true $KDEDIR/bin/start_kdeinit_wrapper --new-startup +kcminit_startup
552
if test $? -ne 0; then
663
if test $? -ne 0; then
553
  # Startup error
664
  # Startup error
554
  echo '[startkde] Could not start kdeinit. Check your installation.' 1>&2
665
  echo '[startkde] Could not start kdeinit. Check your installation.' 1>&2
Lines 557-565 Link Here
557
echo "[startkde] kdeinit started successfully." 1>&2
668
echo "[startkde] kdeinit started successfully." 1>&2
558
669
559
# If the session should be locked from the start (locked autologin),
670
# If the session should be locked from the start (locked autologin),
560
# lock now and do the rest of the KDE startup underneath the locker.
671
# lock now and do the rest of the TDE startup underneath the locker.
561
if test -n "$dl"; then
672
if test -n "$dl"; then
562
  kwrapper kdesktop_lock --forcelock &
673
  $KDEDIR/bin/kwrapper kdesktop_lock --forcelock &
563
  # Give it some time for starting up. This is somewhat unclean; some
674
  # Give it some time for starting up. This is somewhat unclean; some
564
  # notification would be better.
675
  # notification would be better.
565
  sleep 1
676
  sleep 1
Lines 576-582 Link Here
576
# started, any problems thereafter, e.g. ksmserver failing to initialize,
687
# started, any problems thereafter, e.g. ksmserver failing to initialize,
577
# will remain undetected.
688
# will remain undetected.
578
test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM"
689
test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM"
579
kwrapper ksmserver $KDEWM
690
$KDEDIR/bin/kwrapper ksmserver $KDEWM
580
if test $? -eq 255; then
691
if test $? -eq 255; then
581
  # Startup error
692
  # Startup error
582
  echo '[startkde] Could not start ksmserver. Check your installation.' 1>&2
693
  echo '[startkde] Could not start ksmserver. Check your installation.' 1>&2
Lines 584-602 Link Here
584
fi
695
fi
585
696
586
# wait if there's any crashhandler shown
697
# wait if there's any crashhandler shown
587
while dcop | grep -q ^drkonqi- ; do
698
while $KDEDIR/bin/dcop | grep -q ^drkonqi- ; do
588
    sleep 5
699
  sleep 5
589
done
700
done
590
701
591
echo '[startkde] Shutting down Trinity...'  1>&2
702
echo '[startkde] Shutting down Trinity...'  1>&2
592
703
593
# Clean up
704
# Clean up
594
kdeinit_shutdown
705
$KDEDIR/bin/kdeinit_shutdown
595
dcopserver_shutdown --wait
706
$KDEDIR/bin/dcopserver_shutdown --wait
596
artsshell -q terminate
707
$KDEDIR/bin/artsshell -q terminate
597
# KDE4 support
708
# KDE4 support
598
if [ -f /usr/bin/kdeinit4_shutdown ]; then
709
if [ -f /usr/bin/kdeinit4_shutdown ]; then
599
  kde4 kdeinit4_shutdown 2>/dev/null
710
  /usr/bin/kde4 kdeinit4_shutdown 2>/dev/null
600
fi
711
fi
601
712
602
echo '[startkde] Running Trinity shutdown scripts...'  1>&2
713
echo '[startkde] Running Trinity shutdown scripts...'  1>&2

Return to bug 675