|
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 |
| 4 |
# |
4 |
# |
| 5 |
|
5 |
|
|
|
6 |
# Is this a good idea? Looks good for command line logins but |
| 7 |
# graphical login managers likely source these files already? |
| 8 |
# Multiple sourcing is not a problem when the files are only |
| 9 |
# containers for environment variables and such. |
| 10 |
if [ -r /etc/xprofile ]; then |
| 11 |
source /etc/xprofile |
| 12 |
fi |
| 13 |
if [ -r $HOME/.xprofile ]; then |
| 14 |
source $HOME/.xprofile |
| 15 |
fi |
| 16 |
|
| 6 |
echo "[startkde] Starting startkde." 1>&2 |
17 |
echo "[startkde] Starting startkde." 1>&2 |
|
|
18 |
echo "[startkde] This script is $0" 1>&2 |
| 19 |
|
| 20 |
# Avoid any possible conflict with KDE4. Therefore within this script |
| 21 |
# use full path names to all binaries used. |
| 22 |
|
| 23 |
# The binaries for TDE are located in the same place as this script. |
| 24 |
# To determine that location use the following method rather than presuming |
| 25 |
# the existence of $KDEDIR. That environment variable might not be |
| 26 |
# defined or defined to point to KDE4 binaries. |
| 27 |
BIN_DIR="`dirname $0`" |
| 28 |
# Do not use kde-config to determine the version. That command creates a |
| 29 |
# profile directory in the root of the file system. Refer to Bug Report 293. |
| 30 |
if [ -x $BIN_DIR/konqueror ]; then |
| 31 |
KDE_VERSION="`$BIN_DIR/konqueror --version | grep KDE | awk '{print $2}'`" |
| 32 |
echo "TDE version is $KDE_VERSION" 1>&2 |
| 33 |
KDEDIR=`echo $BIN_DIR | sed 's|/bin||'` |
| 34 |
echo "TDE base directory is $KDEDIR" 1>&2 |
| 35 |
echo |
| 36 |
else |
| 37 |
echo "Unable to determine TDE base directory." |
| 38 |
echo "This script should be installed in the same directory." |
| 39 |
echo "Exiting." |
| 40 |
exit 1 |
| 41 |
fi |
| 42 |
unset BIN_DIR |
| 7 |
|
43 |
|
| 8 |
# When the X server dies we get a HUP signal from xinit. We must ignore it |
44 |
# 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. |
45 |
# because we still need to do some cleanup. |
| 10 |
trap '[startkde] echo GOT SIGHUP' HUP |
46 |
trap '[startkde] echo GOT SIGHUP' HUP |
| 11 |
|
47 |
|
| 12 |
# Check if a KDE session is already running. |
48 |
# Check if a TDE session is already running. |
| 13 |
if kcheckrunning >/dev/null 2>&1; then |
49 |
if kcheckrunning >/dev/null 2>&1; then |
| 14 |
echo "[startkde] KDE seems to be already running on this display." |
50 |
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 |
51 |
xmessage -center -geometry 500x100 "TDE seems to be already running on this display." > /dev/null 2>/dev/null |
| 16 |
exit 1 |
52 |
exit 1 |
| 17 |
fi |
53 |
fi |
| 18 |
|
54 |
|
| 19 |
# Set the background color. |
55 |
# Set the background color. |
| 20 |
# The standard X background is nasty, causing moire effects and exploding |
56 |
# 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 |
57 |
# people's heads. We use colours from the standard TDE palette for those with |
| 22 |
# palettised displays. |
58 |
# palettised displays. |
| 23 |
if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then |
59 |
if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then |
| 24 |
xsetroot -solid "#618DCC" # sky blue |
60 |
xsetroot -solid "#618DCC" # sky blue |
| 25 |
fi |
61 |
fi |
| 26 |
|
62 |
|
| 27 |
# Unset this for Darwin since it will screw up KDE's dynamic-loading |
63 |
# Unset this for Darwin since it will screw up TDE's dynamic-loading |
| 28 |
unset DYLD_FORCE_FLAT_NAMESPACE |
64 |
unset DYLD_FORCE_FLAT_NAMESPACE |
| 29 |
|
65 |
|
| 30 |
# Check whether prelinking is enabled. If so, exporting KDE_IS_PRELINKED improves |
66 |
# Check whether prelinking is enabled. If so, exporting KDE_IS_PRELINKED improves |
|
Lines 62-74
Link Here
|
| 62 |
# |
98 |
# |
| 63 |
# * Then ksmserver is started which takes control of the rest of the startup sequence |
99 |
# * Then ksmserver is started which takes control of the rest of the startup sequence |
| 64 |
|
100 |
|
| 65 |
# The user's personal KDE directory usually is $HOME/.kde or $HOME/.trinity. |
101 |
# The user's personal TDE directory usually is $HOME/.trinity. |
| 66 |
# This setting may be overridden by setting $KDEHOME. |
102 |
# 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 |
103 |
# 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, |
104 |
# 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 |
105 |
# $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 |
106 |
# does not mean all people are using KDE4. |
| 71 |
# $HOME/.kde as their preferred profile location for Trinity KDE. |
|
|
| 72 |
|
107 |
|
| 73 |
if [ -n "$KDEHOME" ]; then |
108 |
if [ -n "$KDEHOME" ]; then |
| 74 |
echo "[startkde] KDEHOME is preset to $KDEHOME." 1>&2 |
109 |
echo "[startkde] KDEHOME is preset to $KDEHOME." 1>&2 |
|
Lines 76-90
Link Here
|
| 76 |
else |
111 |
else |
| 77 |
# $KDEHOME is NOT already preset in the environment. Try to help. |
112 |
# $KDEHOME is NOT already preset in the environment. Try to help. |
| 78 |
# This might be overkill but does provide flexibility. |
113 |
# This might be overkill but does provide flexibility. |
|
|
114 |
# This script and kstandardirs.h and kstandardirs.cpp must match. |
| 115 |
# The latter two must be edited/patched before compiling. |
| 79 |
echo "[startkde] KDEHOME is not set." 1>&2 |
116 |
echo "[startkde] KDEHOME is not set." 1>&2 |
| 80 |
if [ -d $HOME/.trinity ]; then |
117 |
if [ -d $HOME/.trinity ]; then |
| 81 |
# OK, this one is obvious. |
118 |
# OK, this one is obvious. |
| 82 |
export KDEHOME=$HOME/.trinity |
119 |
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 |
120 |
elif [ -f /usr/bin/kde4-config ]; then |
| 89 |
# Looks like KDE4 is installed. |
121 |
# Looks like KDE4 is installed. |
| 90 |
if [ -d $HOME/.kde ] && [ ! -d $HOME/.trinity ]; then |
122 |
if [ -d $HOME/.kde ] && [ ! -d $HOME/.trinity ]; then |
|
Lines 95-107
Link Here
|
| 95 |
export KDEHOME=$HOME/.trinity |
127 |
export KDEHOME=$HOME/.trinity |
| 96 |
fi |
128 |
fi |
| 97 |
elif [ -f /opt/trinity/bin/kde-config ]; then |
129 |
elif [ -f /opt/trinity/bin/kde-config ]; then |
| 98 |
# Looks like KDE3 or Trinity is installed and playing second fiddle to KDE4. |
130 |
# 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 |
131 |
export KDEHOME=$HOME/.trinity |
| 103 |
elif [ -f /usr/bin/kde-config ] && [ -d $HOME/.kde ]; then |
132 |
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. |
133 |
# Looks like Trinity is installed and not playing second fiddle to KDE4. |
| 105 |
export KDEHOME=$HOME/.kde |
134 |
export KDEHOME=$HOME/.kde |
| 106 |
else |
135 |
else |
| 107 |
# Resort to this and hope for the best! |
136 |
# Resort to this and hope for the best! |
|
Lines 110-175
Link Here
|
| 110 |
echo "[startkde] Set KDEHOME to $KDEHOME." 1>&2 |
139 |
echo "[startkde] Set KDEHOME to $KDEHOME." 1>&2 |
| 111 |
fi |
140 |
fi |
| 112 |
|
141 |
|
| 113 |
# Run a quick test for root. |
142 |
# Do we want to run this script from here in such an automated manner? |
| 114 |
if [ -z "$KDEROOTHOME" ] && [ "$UID" = "0" ]; then |
143 |
# Or leave the script to be run only at the user's discretion? |
| 115 |
echo "[startkde] User ID is $UID. Setting KDEROOTHOME to $KDEHOME." |
144 |
# The migratekde3 script as written (in draft) requires user intervention, |
| 116 |
export KDEROOTHOME=$KDEHOME |
145 |
# which to succeed in TDE needs something like KDialog. Refer to the |
|
|
146 |
# commentary in migratekde3 for more details. |
| 147 |
# if [ -x $KDEDIR/migratekde3 ]; then |
| 148 |
# sh $KDEDIR/migratekde3 |
| 149 |
# fi |
| 150 |
|
| 151 |
# kdesu needs something to find root's TDE profile. Set the KDEROOTHOME variable |
| 152 |
# here as last resort. /root/.trinity is a safe presumption. If an admin wants |
| 153 |
# a different location then set the KDEROOTHOME variable elsewhere. |
| 154 |
if [ -z "$KDEROOTHOME" ]; then |
| 155 |
export KDEROOTHOME=/root/.trinity |
| 156 |
echo "[startkde] Setting KDEROOTHOME to $KDEROOTHOME." |
| 117 |
fi |
157 |
fi |
| 118 |
|
158 |
|
| 119 |
# Modify the following environment variables only as necessary. |
159 |
# Modify the following environment variables only as necessary. |
| 120 |
if [ -d /opt/trinity/games ]; then |
160 |
if [ -d /opt/trinity/games ]; then |
| 121 |
export PATH=/opt/trinity/games:$PATH |
161 |
if [ -z "`echo $PATH | grep \"/opt/trinity/games\"`" ]; then |
| 122 |
fi |
162 |
export PATH=/opt/trinity/games:$PATH |
| 123 |
if [ -d /opt/trinity/bin ]; then |
163 |
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 |
164 |
fi |
| 129 |
if [ -d /opt/trinity/bin ]; then |
165 |
if [ -d /opt/trinity/bin ]; then |
| 130 |
export PATH=/opt/trinity/bin:$PATH |
166 |
if [ -z "`echo $PATH | grep \"/opt/trinity/bin\"`" ]; then |
| 131 |
fi |
167 |
export PATH=/opt/trinity/bin:$PATH |
| 132 |
if [ -d /opt/trinity/share ]; then |
168 |
fi |
| 133 |
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/trinity/share/:/usr/share/ |
|
|
| 134 |
fi |
169 |
fi |
| 135 |
if [ -d /opt/trinity/share ]; then |
170 |
if [ -d /opt/trinity/share ]; then |
| 136 |
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/trinity/share/:/usr/share/ |
171 |
if [ -z "`echo $PATH | grep \"/opt/trinity/share\"`" ]; then |
| 137 |
fi |
172 |
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/opt/trinity/share |
| 138 |
if [ -d /opt/trinity/etc/xdg ]; then |
173 |
fi |
| 139 |
export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/opt/trinity/etc/xdg/:/etc/xdg/ |
|
|
| 140 |
fi |
174 |
fi |
| 141 |
if [ -d /opt/trinity/etc/xdg ]; then |
175 |
if [ -d /opt/trinity/etc/xdg ]; then |
| 142 |
export XDG_CONFIG_DIRS=$XDG_CONFIG_DIRS:/opt/trinity/etc/xdg/:/etc/xdg/ |
176 |
if [ -z "`echo $PATH | grep \"/opt/trinity/etc/xdg\"`" ]; then |
| 143 |
fi |
177 |
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 |
178 |
fi |
| 156 |
fi |
179 |
fi |
| 157 |
if [ -d /opt/trinity ]; then |
180 |
if [ -d /opt/trinity/share/man ]; then |
| 158 |
if [ -n "$KDEDIRS" ]; then |
181 |
if [ -z "`echo $PATH | grep \"/opt/trinity/share/man\"`" ]; then |
| 159 |
export KDEDIRS=$KDEDIRS:/opt/trinity/:/usr/ |
182 |
export MANPATH=/opt/trinity/share/man:$MANPATH |
| 160 |
else |
|
|
| 161 |
export KDEDIRS=/opt/trinity/:/usr/ |
| 162 |
fi |
183 |
fi |
| 163 |
fi |
184 |
fi |
| 164 |
|
185 |
|
| 165 |
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME" | sed "s,^~/,$HOME/,"` |
186 |
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME" | sed "s,^~/,$HOME/,"` |
| 166 |
echo "[startkde] kdehome: $kdehome" 1>&2 |
|
|
| 167 |
|
187 |
|
| 168 |
# Allow interested applications, such as the Plasma control wrapper, |
188 |
# Allow interested applications, such as the Plasma control wrapper, |
| 169 |
# to know that this is a Trinity desktop and not a KDE one. |
189 |
# to know that this is a Trinity desktop and not a KDE one. |
| 170 |
export DESKTOP_SESSION=trinity |
190 |
export DESKTOP_SESSION=trinity |
| 171 |
|
191 |
|
| 172 |
# Please see kstartupconfig source for usage. |
192 |
# Please see kstartupconfig source for usage. |
|
|
193 |
if [ ! -d "$HOME/.trinity" ]; then |
| 194 |
echo "[startkde] Creating $HOME/.trinity." 1>&2 |
| 195 |
fi |
| 173 |
mkdir -m 700 -p $kdehome |
196 |
mkdir -m 700 -p $kdehome |
| 174 |
mkdir -m 700 -p $kdehome/share |
197 |
mkdir -m 700 -p $kdehome/share |
| 175 |
mkdir -m 700 -p $kdehome/share/config |
198 |
mkdir -m 700 -p $kdehome/share/config |
|
Lines 185-193
Link Here
|
| 185 |
kcmrandrrc [Screen3] |
208 |
kcmrandrrc [Screen3] |
| 186 |
kcmfonts General forceFontDPI 0 |
209 |
kcmfonts General forceFontDPI 0 |
| 187 |
EOF |
210 |
EOF |
| 188 |
kstartupconfig |
211 |
$KDEDIR/bin/kstartupconfig |
| 189 |
if test $? -ne 0; then |
212 |
if test $? -ne 0; then |
| 190 |
xmessage -geometry 500x100 "Could not start kstartupconfig. Check your installation." |
213 |
xmessage -center -geometry 500x100 "Could not start kstartupconfig. Check your installation." |
| 191 |
fi |
214 |
fi |
| 192 |
# $kdehome/share/config/startupconfig should exist but avoid script failure if not. |
215 |
# $kdehome/share/config/startupconfig should exist but avoid script failure if not. |
| 193 |
if [ -r $kdehome/share/config/startupconfig ]; then |
216 |
if [ -r $kdehome/share/config/startupconfig ]; then |
|
Lines 196-202
Link Here
|
| 196 |
|
219 |
|
| 197 |
# Make sure a default wallpaper is set. |
220 |
# Make sure a default wallpaper is set. |
| 198 |
if [ ! -e $kdehome/share/config/kdesktoprc ]; then |
221 |
if [ ! -e $kdehome/share/config/kdesktoprc ]; then |
| 199 |
# With Trinity KDE this file should exist, but test first. |
222 |
# With Trinity this file should exist, but test first. |
| 200 |
if [ -r /usr/share/wallpapers/isadora.png.desktop ]; then |
223 |
if [ -r /usr/share/wallpapers/isadora.png.desktop ]; then |
| 201 |
cat >$kdehome/share/config/kdesktoprc <<EOF |
224 |
cat >$kdehome/share/config/kdesktoprc <<EOF |
| 202 |
[Desktop0] |
225 |
[Desktop0] |
|
Lines 208-291
Link Here
|
| 208 |
|
231 |
|
| 209 |
# XCursor mouse theme needs to be applied here to work even for kded or ksmserver. |
232 |
# 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 |
233 |
if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then |
| 211 |
kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize" |
234 |
kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize" |
| 212 |
if test $? -eq 10; then |
235 |
if test $? -eq 10; then |
| 213 |
export XCURSOR_THEME=default |
236 |
export XCURSOR_THEME=default |
| 214 |
elif test -n "$kcminputrc_mouse_cursortheme"; then |
237 |
elif test -n "$kcminputrc_mouse_cursortheme"; then |
| 215 |
export XCURSOR_THEME="$kcminputrc_mouse_cursortheme" |
238 |
export XCURSOR_THEME="$kcminputrc_mouse_cursortheme" |
| 216 |
fi |
239 |
fi |
| 217 |
if test -n "$kcminputrc_mouse_cursorsize"; then |
240 |
if test -n "$kcminputrc_mouse_cursorsize"; then |
| 218 |
export XCURSOR_SIZE="$kcminputrc_mouse_cursorsize" |
241 |
export XCURSOR_SIZE="$kcminputrc_mouse_cursorsize" |
| 219 |
fi |
242 |
fi |
| 220 |
fi |
243 |
fi |
| 221 |
|
244 |
|
| 222 |
if test "$kcmrandrrc_display_applyonstartup" = "true"; then |
245 |
if test "$kcmrandrrc_display_applyonstartup" = "true"; then |
| 223 |
# 4 screens is hopefully enough |
246 |
# 4 screens is hopefully enough |
| 224 |
for scrn in 0 1 2 3; do |
247 |
for scrn in 0 1 2 3; do |
| 225 |
args= |
248 |
args= |
| 226 |
width="\$kcmrandrrc_screen${scrn}_width" ; eval "width=$width" |
249 |
width="\$kcmrandrrc_screen${scrn}_width" ; eval "width=$width" |
| 227 |
height="\$kcmrandrrc_screen${scrn}_height" ; eval "height=$height" |
250 |
height="\$kcmrandrrc_screen${scrn}_height" ; eval "height=$height" |
| 228 |
if test -n "${width}" -a -n "${height}"; then |
251 |
if test -n "${width}" -a -n "${height}"; then |
| 229 |
args="$args -s ${width}x${height}" |
252 |
args="$args -s ${width}x${height}" |
| 230 |
fi |
253 |
fi |
| 231 |
refresh="\$kcmrandrrc_screen${scrn}_refresh" ; eval "refresh=$refresh" |
254 |
refresh="\$kcmrandrrc_screen${scrn}_refresh" ; eval "refresh=$refresh" |
| 232 |
if test -n "${refresh}"; then |
255 |
if test -n "${refresh}"; then |
| 233 |
args="$args -r ${refresh}" |
256 |
args="$args -r ${refresh}" |
| 234 |
fi |
257 |
fi |
| 235 |
rotation="\$kcmrandrrc_screen${scrn}_rotation" ; eval "rotation=$rotation" |
258 |
rotation="\$kcmrandrrc_screen${scrn}_rotation" ; eval "rotation=$rotation" |
| 236 |
if test -n "${rotation}"; then |
259 |
if test -n "${rotation}"; then |
| 237 |
case "${rotation}" in |
260 |
case "${rotation}" in |
| 238 |
0) |
261 |
0) |
| 239 |
args="$args -o 0" |
262 |
args="$args -o 0" |
| 240 |
;; |
263 |
;; |
| 241 |
90) |
264 |
90) |
| 242 |
args="$args -o 1" |
265 |
args="$args -o 1" |
| 243 |
;; |
266 |
;; |
| 244 |
180) |
267 |
180) |
| 245 |
args="$args -o 2" |
268 |
args="$args -o 2" |
| 246 |
;; |
269 |
;; |
| 247 |
270) |
270 |
270) |
| 248 |
args="$args -o 3" |
271 |
args="$args -o 3" |
| 249 |
;; |
272 |
;; |
| 250 |
esac |
273 |
esac |
| 251 |
fi |
274 |
fi |
| 252 |
reflectx="\$kcmrandrrc_screen${scrn}_reflectx" ; eval "reflectx=$reflectx" |
275 |
reflectx="\$kcmrandrrc_screen${scrn}_reflectx" ; eval "reflectx=$reflectx" |
| 253 |
if test "${refrectx}" = "true"; then |
276 |
if test "${refrectx}" = "true"; then |
| 254 |
args="$args -x" |
277 |
args="$args -x" |
| 255 |
fi |
278 |
fi |
| 256 |
reflecty="\$kcmrandrrc_screen${scrn}_reflecty" ; eval "reflecty=$reflecty" |
279 |
reflecty="\$kcmrandrrc_screen${scrn}_reflecty" ; eval "reflecty=$reflecty" |
| 257 |
if test "${refrecty}" = "true"; then |
280 |
if test "${refrecty}" = "true"; then |
| 258 |
args="$args -y" |
281 |
args="$args -y" |
| 259 |
fi |
282 |
fi |
| 260 |
if test -n "$args"; then |
283 |
if test -n "$args"; then |
| 261 |
xrandr $args |
284 |
xrandr $args |
| 262 |
fi |
285 |
fi |
| 263 |
done |
286 |
done |
| 264 |
fi |
287 |
fi |
| 265 |
|
288 |
|
| 266 |
dl=$DESKTOP_LOCKED |
289 |
dl=$DESKTOP_LOCKED |
| 267 |
unset DESKTOP_LOCKED # Don't want it in the environment |
290 |
unset DESKTOP_LOCKED # Don't want it in the environment |
| 268 |
|
291 |
|
| 269 |
# Launch splash that doesn't need any KDE libraries here, before |
292 |
# Launch splash that doesn't need any TDE libraries here, before |
| 270 |
# KDE libraries are loaded into memory (which may take some time |
293 |
# TDE libraries are loaded into memory (which may take some time |
| 271 |
# with cold caches). Makes the splash appear sooner. |
294 |
# with cold caches). Makes the splash appear sooner. |
| 272 |
# If kpersonalizer needs to be run splash will be started only later. |
295 |
# If kpersonalizer needs to be run splash will be started only later. |
| 273 |
if test -z "$dl" && test "$kpersonalizerrc_general_firstlogin" != "true"; then |
296 |
if test -z "$dl" && test "$kpersonalizerrc_general_firstlogin" != "true"; then |
| 274 |
case "$ksplashrc_ksplash_theme" in |
297 |
case "$ksplashrc_ksplash_theme" in |
| 275 |
Simple) |
298 |
Simple) |
| 276 |
ksplashsimple |
299 |
ksplashsimple |
| 277 |
;; |
300 |
;; |
| 278 |
*) |
301 |
*) |
| 279 |
;; |
302 |
;; |
| 280 |
esac |
303 |
esac |
| 281 |
fi |
304 |
fi |
| 282 |
|
305 |
|
| 283 |
if test "$kcmfonts_general_forcefontdpi" -eq 120; then |
306 |
if test "$kcmfonts_general_forcefontdpi" -eq 120; then |
| 284 |
xrdb -quiet -merge -nocpp <<EOF |
307 |
xrdb -quiet -merge -nocpp <<EOF |
| 285 |
Xft.dpi: 120 |
308 |
Xft.dpi: 120 |
| 286 |
EOF |
309 |
EOF |
| 287 |
elif test "$kcmfonts_general_forcefontdpi" -eq 96; then |
310 |
elif test "$kcmfonts_general_forcefontdpi" -eq 96; then |
| 288 |
xrdb -quiet -merge -nocpp <<EOF |
311 |
xrdb -quiet -merge -nocpp <<EOF |
| 289 |
Xft.dpi: 96 |
312 |
Xft.dpi: 96 |
| 290 |
EOF |
313 |
EOF |
| 291 |
fi |
314 |
fi |
|
Lines 321-330
Link Here
|
| 321 |
fi |
344 |
fi |
| 322 |
|
345 |
|
| 323 |
# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh |
346 |
# 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) |
347 |
# (where <localprefix> is $KDEHOME or ~/.trinity, and <prefixes> is where TDE is installed) |
| 325 |
# |
348 |
# |
| 326 |
# This is where you can define environment variables that will be available to |
349 |
# 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` |
350 |
# all TDE programs, so this is where you can run agents using e.g. eval `ssh-agent` |
| 328 |
# or eval `gpg-agent --daemon`. |
351 |
# or eval `gpg-agent --daemon`. |
| 329 |
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script |
352 |
# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script |
| 330 |
# |
353 |
# |
|
Lines 340-346
Link Here
|
| 340 |
done |
363 |
done |
| 341 |
done |
364 |
done |
| 342 |
|
365 |
|
| 343 |
# Activate the kde font directories. |
366 |
# Activate the TDE font directories. |
| 344 |
# |
367 |
# |
| 345 |
# There are 4 directories that may be used for supplying fonts for KDE. |
368 |
# There are 4 directories that may be used for supplying fonts for KDE. |
| 346 |
# |
369 |
# |
|
Lines 365-386
Link Here
|
| 365 |
do_usr_fdir=1 |
388 |
do_usr_fdir=1 |
| 366 |
do_usr_odir=1 |
389 |
do_usr_odir=1 |
| 367 |
if test -r "$kde_fontpaths" ; then |
390 |
if test -r "$kde_fontpaths" ; then |
| 368 |
savifs=$IFS |
391 |
savifs=$IFS |
| 369 |
IFS=" |
392 |
IFS=" |
| 370 |
" |
393 |
" |
| 371 |
for fpath in `grep -v '^[ ]*#' < "$kde_fontpaths"` ; do |
394 |
for fpath in `grep -v '^[ ]*#' < "$kde_fontpaths"` ; do |
| 372 |
rfpath=`echo $fpath | sed "s:^~:$HOME:g"` |
395 |
rfpath=`echo $fpath | sed "s:^~:$HOME:g"` |
| 373 |
if test -s "$rfpath"/fonts.dir; then |
396 |
if test -s "$rfpath"/fonts.dir; then |
| 374 |
xset fp+ "$rfpath" |
397 |
xset fp+ "$rfpath" |
| 375 |
if test "$rfpath" = "$usr_fdir"; then |
398 |
if test "$rfpath" = "$usr_fdir"; then |
| 376 |
do_usr_fdir=0 |
399 |
do_usr_fdir=0 |
| 377 |
fi |
400 |
fi |
| 378 |
if test "$rfpath" = "$usr_odir"; then |
401 |
if test "$rfpath" = "$usr_odir"; then |
| 379 |
do_usr_odir=0 |
402 |
do_usr_odir=0 |
| 380 |
fi |
403 |
fi |
| 381 |
fi |
404 |
fi |
| 382 |
done |
405 |
done |
| 383 |
IFS=$savifs |
406 |
IFS=$savifs |
| 384 |
fi |
407 |
fi |
| 385 |
|
408 |
|
| 386 |
if [ ! -n "$KDEDIR" ]; then |
409 |
if [ ! -n "$KDEDIR" ]; then |
|
Lines 438-444
Link Here
|
| 438 |
|
461 |
|
| 439 |
# Set a left cursor instead of the standard X11 "X" cursor, since I've heard |
462 |
# 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 |
463 |
# 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 |
464 |
# especially necessary on slow machines, where starting TDE takes one or two |
| 442 |
# minutes until anything appears on the screen. |
465 |
# minutes until anything appears on the screen. |
| 443 |
# |
466 |
# |
| 444 |
# If the user has overwritten fonts, the cursor font may be different now |
467 |
# If the user has overwritten fonts, the cursor font may be different now |
|
Lines 446-452
Link Here
|
| 446 |
# |
469 |
# |
| 447 |
xsetroot -cursor_name left_ptr |
470 |
xsetroot -cursor_name left_ptr |
| 448 |
|
471 |
|
| 449 |
# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap |
472 |
# Get Ghostscript to look into user's TDE fonts dir for additional Fontmap |
| 450 |
if test -n "$GS_LIB" ; then |
473 |
if test -n "$GS_LIB" ; then |
| 451 |
GS_LIB=$usr_fdir:$GS_LIB |
474 |
GS_LIB=$usr_fdir:$GS_LIB |
| 452 |
export GS_LIB |
475 |
export GS_LIB |
|
Lines 455-477
Link Here
|
| 455 |
export GS_LIB |
478 |
export GS_LIB |
| 456 |
fi |
479 |
fi |
| 457 |
|
480 |
|
| 458 |
# Link "tmp" "socket" and "cache" resources to directory in /tmp |
481 |
# Link "tmp" "socket" and "cache" resources to directory in $TMP |
| 459 |
# Creates: |
482 |
# Creates: |
| 460 |
# - a directory /tmp/kde-$USER and links $KDEHOME/tmp-$HOSTNAME to it. |
483 |
# - 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. |
484 |
# - 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. |
485 |
# - 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 |
486 |
# Note: temporary locations can be overriden through the KDETMP and KDEVARTMP |
| 464 |
# environment variables. |
487 |
# environment variables. |
| 465 |
for resource in tmp cache socket; do |
488 |
for resource in tmp cache socket; do |
| 466 |
if ! lnusertemp $resource >/dev/null; then |
489 |
if ! lnusertemp $resource >/dev/null; then |
| 467 |
echo "[startkde] Call to lnusertemp failed (temporary directories full?). Check your installation." 1>&2 |
490 |
echo "[startkde] Call to lnusertemp failed (temporary directories full?). Check your installation." 1>&2 |
| 468 |
xmessage -geometry 600x100 "Call to lnusertemp failed (temporary directories full?). Check your installation." |
491 |
xmessage -center -geometry 600x100 "Call to lnusertemp failed (temporary directories full?). Check your installation." |
| 469 |
exit 1 |
492 |
exit 1 |
| 470 |
fi |
493 |
fi |
| 471 |
done |
494 |
done |
| 472 |
|
495 |
|
| 473 |
# In case of dcop sockets left by a previous session, cleanup. |
496 |
# In case of dcop sockets left by a previous session, cleanup. |
| 474 |
dcopserver_shutdown |
497 |
$KDEDIR/bin/dcopserver_shutdown |
| 475 |
|
498 |
|
| 476 |
echo '[startkde] Starting Trinity...' 1>&2 |
499 |
echo '[startkde] Starting Trinity...' 1>&2 |
| 477 |
|
500 |
|
|
Lines 481-499
Link Here
|
| 481 |
# Run KPersonalizer before the session if this is the first login. |
504 |
# Run KPersonalizer before the session if this is the first login. |
| 482 |
if test "$kpersonalizerrc_general_firstlogin" = "true"; then |
505 |
if test "$kpersonalizerrc_general_firstlogin" = "true"; then |
| 483 |
if [ ! -x $KDEDIR/bin/kpersonalizer ]; then |
506 |
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 |
507 |
echo "[startkde] kpersonalizer not found! Please install in order to properly configure your user profile." 1>&2 |
| 485 |
else |
508 |
else |
| 486 |
# start only dcopserver, don't start whole kdeinit (takes too long) |
509 |
# start only dcopserver, don't start whole kdeinit (takes too long) |
| 487 |
echo "[startkde] Running kpersonalizer..." 1>&2 |
510 |
echo "[startkde] Running kpersonalizer..." 1>&2 |
| 488 |
dcopserver |
511 |
$KDEDIR/bin/dcopserver |
| 489 |
kwin --lock & |
512 |
$KDEDIR/bin/kwin --lock & |
| 490 |
kpersonalizer --before-session |
513 |
$KDEDIR/bin/kpersonalizer --before-session |
| 491 |
# handle kpersonalizer restarts (language change) |
514 |
# handle kpersonalizer restarts (language change) |
| 492 |
while test $? -eq 1; do |
515 |
while test $? -eq 1; do |
| 493 |
kpersonalizer --r --before-session |
516 |
$KDEDIR/bin/kpersonalizer --r --before-session |
| 494 |
done |
517 |
done |
| 495 |
dcopquit kwin |
518 |
$KDEDIR/bin/dcopquit kwin |
| 496 |
dcopserver_shutdown --wait |
519 |
$KDEDIR/bin/dcopserver_shutdown --wait |
| 497 |
fi |
520 |
fi |
| 498 |
fi |
521 |
fi |
| 499 |
|
522 |
|
|
Lines 508-532
Link Here
|
| 508 |
# the splashscreen and progress indicator |
531 |
# the splashscreen and progress indicator |
| 509 |
case "$ksplashrc_ksplash_theme" in |
532 |
case "$ksplashrc_ksplash_theme" in |
| 510 |
None) |
533 |
None) |
| 511 |
;; # nothing |
534 |
;; # nothing |
| 512 |
Simple) |
535 |
Simple) |
| 513 |
if test "$kpersonalizerrc_general_firstlogin" = "true"; then |
536 |
if test "$kpersonalizerrc_general_firstlogin" = "true"; then |
| 514 |
ksplashsimple |
537 |
$KDEDIR/bin/ksplashsimple |
| 515 |
fi # otherwise started earlier |
538 |
fi # otherwise started earlier |
| 516 |
;; |
539 |
;; |
| 517 |
*) |
540 |
*) |
| 518 |
ksplash --nodcop |
541 |
$KDEDIR/bin/ksplash --nodcop |
| 519 |
;; |
542 |
;; |
| 520 |
esac |
543 |
esac |
| 521 |
fi |
544 |
fi |
| 522 |
|
545 |
|
| 523 |
# Mark that full KDE session is running (e.g. Konqueror preloading works only |
546 |
# 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 |
547 |
# 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 |
548 |
# 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 |
549 |
# 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 |
550 |
# 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. |
551 |
# 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: |
552 |
# The matching tests are: |
| 531 |
# For $TDE_FULL_SESSION: |
553 |
# For $TDE_FULL_SESSION: |
| 532 |
# if test -n "$TDE_FULL_SESSION"; then ... whatever |
554 |
# 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 |
556 |
# xprop -root | grep "^TDE_FULL_SESSION" >/dev/null 2>/dev/null |
| 535 |
# if test $? -eq 0; then ... whatever |
557 |
# if test $? -eq 0; then ... whatever |
| 536 |
# |
558 |
# |
| 537 |
# Additionally there is (since KDE 3.5.7) $KDE_SESSION_UID with the uid |
559 |
# 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. |
560 |
# 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). |
561 |
# after sudo to prevent desktop-wide functionality in the new user's kded). |
| 540 |
# |
562 |
# |
| 541 |
TDE_FULL_SESSION=true |
563 |
TDE_FULL_SESSION=true |
|
Lines 548-565
Link Here
|
| 548 |
|
570 |
|
| 549 |
# We set LD_BIND_NOW to increase the efficiency of kdeinit. |
571 |
# We set LD_BIND_NOW to increase the efficiency of kdeinit. |
| 550 |
# kdeinit unsets this variable before loading applications. |
572 |
# kdeinit unsets this variable before loading applications. |
| 551 |
LD_BIND_NOW=true start_kdeinit_wrapper --new-startup +kcminit_startup |
573 |
LD_BIND_NOW=true $KDEDIR/bin/start_kdeinit_wrapper --new-startup +kcminit_startup |
| 552 |
if test $? -ne 0; then |
574 |
if test $? -ne 0; then |
| 553 |
# Startup error |
575 |
# Startup error |
| 554 |
echo '[startkde] Could not start kdeinit. Check your installation.' 1>&2 |
576 |
echo '[startkde] Could not start kdeinit. Check your installation.' 1>&2 |
| 555 |
xmessage -geometry 500x100 "Could not start kdeinit. Check your installation." |
577 |
xmessage -center -geometry 500x100 "Could not start kdeinit. Check your installation." |
| 556 |
fi |
578 |
fi |
| 557 |
echo "[startkde] kdeinit started successfully." 1>&2 |
579 |
echo "[startkde] kdeinit started successfully." 1>&2 |
| 558 |
|
580 |
|
| 559 |
# If the session should be locked from the start (locked autologin), |
581 |
# 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. |
582 |
# lock now and do the rest of the TDE startup underneath the locker. |
| 561 |
if test -n "$dl"; then |
583 |
if test -n "$dl"; then |
| 562 |
kwrapper kdesktop_lock --forcelock & |
584 |
$KDEDIR/bin/kwrapper kdesktop_lock --forcelock & |
| 563 |
# Give it some time for starting up. This is somewhat unclean; some |
585 |
# Give it some time for starting up. This is somewhat unclean; some |
| 564 |
# notification would be better. |
586 |
# notification would be better. |
| 565 |
sleep 1 |
587 |
sleep 1 |
|
Lines 576-602
Link Here
|
| 576 |
# started, any problems thereafter, e.g. ksmserver failing to initialize, |
598 |
# started, any problems thereafter, e.g. ksmserver failing to initialize, |
| 577 |
# will remain undetected. |
599 |
# will remain undetected. |
| 578 |
test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM" |
600 |
test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM" |
| 579 |
kwrapper ksmserver $KDEWM |
601 |
$KDEDIR/bin/kwrapper ksmserver $KDEWM |
| 580 |
if test $? -eq 255; then |
602 |
if test $? -eq 255; then |
| 581 |
# Startup error |
603 |
# Startup error |
| 582 |
echo '[startkde] Could not start ksmserver. Check your installation.' 1>&2 |
604 |
echo '[startkde] Could not start ksmserver. Check your installation.' 1>&2 |
| 583 |
xmessage -geometry 500x100 "Could not start ksmserver. Check your installation." |
605 |
xmessage -center -geometry 500x100 "Could not start ksmserver. Check your installation." |
| 584 |
fi |
606 |
fi |
| 585 |
|
607 |
|
| 586 |
# wait if there's any crashhandler shown |
608 |
# wait if there's any crashhandler shown |
| 587 |
while dcop | grep -q ^drkonqi- ; do |
609 |
while $KDEDIR/bin/dcop | grep -q ^drkonqi- ; do |
| 588 |
sleep 5 |
610 |
sleep 5 |
| 589 |
done |
611 |
done |
| 590 |
|
612 |
|
| 591 |
echo '[startkde] Shutting down Trinity...' 1>&2 |
613 |
echo '[startkde] Shutting down Trinity...' 1>&2 |
| 592 |
|
614 |
|
| 593 |
# Clean up |
615 |
# Clean up |
| 594 |
kdeinit_shutdown |
616 |
$KDEDIR/bin/kdeinit_shutdown |
| 595 |
dcopserver_shutdown --wait |
617 |
$KDEDIR/bin/dcopserver_shutdown --wait |
| 596 |
artsshell -q terminate |
618 |
$KDEDIR/bin/artsshell -q terminate |
| 597 |
# KDE4 support |
619 |
# KDE4 support |
| 598 |
if [ -f /usr/bin/kdeinit4_shutdown ]; then |
620 |
if [ -f /usr/bin/kdeinit4_shutdown ]; then |
| 599 |
kde4 kdeinit4_shutdown 2>/dev/null |
621 |
/usr/bin/kde4 kdeinit4_shutdown 2>/dev/null |
| 600 |
fi |
622 |
fi |
| 601 |
|
623 |
|
| 602 |
echo '[startkde] Running Trinity shutdown scripts...' 1>&2 |
624 |
echo '[startkde] Running Trinity shutdown scripts...' 1>&2 |