Disable Nepomuk by default on all new installs.
[opensuse:kdebase4-opensuse.git] / config-files / usr / share / kde4 / env / startkde.suse.sh
1 #!/bin/sh
2
3 #
4 # do we run in a prelinked system ?
5 #
6 if test -f /etc/sysconfig/prelink; then
7 . /etc/sysconfig/prelink
8   if test "$USE_PRELINK" = "yes" ; then
9      KDE_IS_PRELINKED=1
10      export KDE_IS_PRELINKED
11   else
12      unset KDE_IS_PRELINKED
13   fi
14 fi
15
16
17 # workaround SaX/SUSE bug that doesn't setup a proper keyboard map
18 #
19
20 if [ -f /usr/share/hotkey-setup/hotkey-setup.xmodmap ]; then
21   xmodmap /usr/share/hotkey-setup/hotkey-setup.xmodmap
22 fi
23
24 #
25 # Do we have a special Gtk theming for our Qt widget theme ?
26 #
27 if [ ! -e $HOME/.no-qtrc-to-gtkrc-mapping ]; then
28
29   SUSE_VERSION="`cat /etc/SuSE-release | sed -n 's/VERSION = //p'`"
30
31     # Defaults for openSUSE 10.3
32     GTK2_SYSCONFDIR=/etc
33     GTK2_DATADIR=/usr/share/themes/
34
35   # use general gtk-qt-engine
36   if [ -e "$GTK2_DATADIR/Qt/gtk-2.0/gtkrc" ] ; then
37     GTK2_THEME_RC="$GTK2_DATADIR/Qt/gtk-2.0/gtkrc"
38   else
39     # use QtCurve engine
40     if [ -e "$GTK2_DATADIR/QtCurve/gtk-2.0/gtkrc" ] ; then
41        GTK2_THEME_RC="$GTK2_DATADIR/QtCurve/gtk-2.0/gtkrc"
42     fi
43   fi
44
45   # GTK2
46   # NOTE: ~/.gtkrc-2.0-kde is added later (in latest KDE only)
47   if [ "$GTK2_RC_FILES" ]; then
48     export GTK2_RC_FILES="$GTK2_RC_FILES:$GTK2_THEME_RC:$HOME/.gtkrc-2.0-qtengine:$HOME/.gtkrc-2.0"
49   else
50     export GTK2_RC_FILES="$GTK2_SYSCONFDIR/gtk-2.0/gtkrc:$GTK2_THEME_RC:$HOME/.gtkrc-2.0-qtengine:$HOME/.gtkrc-2.0"
51   fi
52
53 fi
54
55 if [ -r /etc/sysconfig/windowmanager ]; then
56   # Do the user want the SuSE theme ?
57   source /etc/sysconfig/windowmanager
58
59   # Should we really enable FAM support for KDE ?
60   export USE_FAM="$KDE_USE_FAM"
61
62   # Disable IPv6 ?
63   if [ "$KDE_USE_IPV6" = "no" ]; then
64      export KDE_NO_IPV6=1
65   fi
66   # Disable IDN ?
67   if [ "$KDE_USE_IDN" = "no" ]; then
68      export KDE_NO_IDN=1
69   fi
70
71 else
72   if [ -r /etc/rc.config ]; then
73     # Do the user want the SuSE theme ?
74     INSTALL_DESKTOP_EXTENSIONS=`bash -c "source /etc/rc.config && echo \\$INSTALL_DESKTOP_EXTENSIONS"`
75
76     # Should we really enable FAM support for KDE ?
77     USE_FAM=`bash -c "source /etc/rc.config && echo \\$KDE_USE_FAM"`
78     export USE_FAM
79   fi
80 fi
81
82 #
83 # create SuSE defaults
84 #
85 if [ ! -e "$HOME/.skel/kdebase4.110" ]; then
86     mkdir -p $HOME/Desktop
87
88     if [ -e "/usr/bin/firefox" -a ! -e "$HOME/Desktop/MozillaFirefox.desktop" -a -e "/usr/share/kde4/config/SuSE/default/MozillaFirefox.desktop" ]; then
89           cp /usr/share/kde4/config/SuSE/default/MozillaFirefox.desktop $HOME/Desktop/
90           chmod u+x $HOME/Desktop/MozillaFirefox.desktop
91     fi
92
93     if [ -e "/usr/bin/oofromtemplate" -a  ! -e "$HOME/Desktop/Office.desktop" -a -e "/usr/share/kde4/config/SuSE/default/Office.desktop" ]; then
94           cp /usr/share/kde4/config/SuSE/default/Office.desktop $HOME/Desktop/
95           chmod u+x $HOME/Desktop/Office.desktop
96     fi
97
98     if [ ! -e "$HOME/Desktop/SuSE.desktop" -a -e "/usr/share/kde4/config/SuSE/default/SuSE.desktop" ]; then
99           cp /usr/share/kde4/config/SuSE/default/SuSE.desktop $HOME/Desktop/
100           chmod u+x $HOME/Desktop/SuSE.desktop
101     fi
102
103     if [ ! -e "$HOME/Desktop/Support.desktop" -a -e "/usr/share/kde4/config/SuSE/default/Support.desktop" ]; then
104           cp /usr/share/kde4/config/SuSE/default/Support.desktop $HOME/Desktop/
105           chmod u+x $HOME/Desktop/Support.desktop
106     fi
107
108     if [ ! -e "$HOME/Desktop/myComputer.desktop" -a -e "/usr/share/kde4/config/SuSE/default/myComputer.desktop" ]; then
109           cp /usr/share/kde4/config/SuSE/default/myComputer.desktop $HOME/Desktop/
110           chmod u+x $HOME/Desktop/myComputer.desktop
111     fi
112
113     if [ ! -e $HOME/.kde4/share/config/kdeglobals -a -e /usr/share/kde4/config/SuSE/default/kdeglobals ]; then
114           mkdir -p $HOME/.kde4/share/config
115           cp /usr/share/kde4/config/SuSE/default/kdeglobals $HOME/.kde4/share/config/kdeglobals
116           # add Language= and Country=
117           local=`/usr/bin/locale 2>&1 | grep LC_MESSAGES | sed -e 's#^LC_MESSAGES="\(.*\)"$#\1#; s#\..*##'`
118           lang=`echo $local | sed -e 's,_.*$,,'`
119           countr=`echo $local | sed -e 's,^.*_,,' | tr 'A-Z' 'a-z'`
120           if test -z "$countr"; then countr=$lang; fi
121           cat >>$HOME/.kde4/share/config/kdeglobals <<EOF
122 [Locale]
123 Country=$countr
124 Language=$lang
125 EOF
126     fi
127
128     if [ ! -e $HOME/.kde4/share/config/kcminputrc -a -e /usr/share/kde4/config/SuSE/default/kcminputrc ]; then
129           mkdir -p $HOME/.kde4/share/config
130           cp /usr/share/kde4/config/SuSE/default/kcminputrc $HOME/.kde4/share/config/kcminputrc
131     fi
132
133     if [ ! -e $HOME/.kde4/share/config/nepomukserverrc -a -e /usr/share/kde4/config/SuSE/default/nepomukserverrc ]; then
134           mkdir -p $HOME/.kde4/share/config
135           cp /usr/share/kde4/config/SuSE/default/nepomukserverrc $HOME/.kde4/share/config/nepomukserverrc
136     fi
137
138     if [ ! -e "$HOME/.kde4/share/apps/konqueror/bookmarks.xml" -a -e "/usr/share/kde4/config/SuSE/default/bookmarks.xml" ]; then
139           mkdir -p $HOME/.kde4/share/apps/konqueror
140           cp /usr/share/kde4/config/SuSE/default/bookmarks.xml $HOME/.kde4/share/apps/konqueror/bookmarks.xml
141     fi
142
143     if [ ! -e "$HOME/.kde4/share/apps/akregator/data/feeds.opml" -a -e "/usr/share/kde4/config/SuSE/default/feeds.opml" ]; then
144           mkdir -p $HOME/.kde4/share/apps/akregator/data
145           cp /usr/share/kde4/config/SuSE/default/feeds.opml $HOME/.kde4/share/apps/akregator/data/feeds.opml
146     fi
147
148     mkdir -p $HOME/.skel/
149     touch $HOME/.skel/kdebase4.110
150 fi
151
152 # check if any rpms have been (un)installed since ksycoca
153 # had been built, if yes, trigger ksycoca rebuild immediatelly
154 # instead of delayed
155
156 kdehome=$HOME/.kde4
157 test -n "$KDEHOME" && kdehome=`echo "$KDEHOME"|sed "s,^~/,$HOME/,"`
158 host=$HOSTNAME
159 test -n "$XAUTHLOCALHOSTNAME" && host=$XAUTHLOCALHOSTNAME
160 ksycoca="$kdehome/cache-$host/ksycoca"
161
162 if test -f "$ksycoca"; then
163     if test -f /var/lib/rpm/Packages; then
164         if test /var/lib/rpm/Packages -nt "$ksycoca"; then
165             rm -f "$ksycoca"
166         fi
167     fi
168 fi