2006-12-27 12:49:58 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2007-04-06 00:16:55 +02:00
|
|
|
# This is not the original gnome-session but a start script
|
2008-04-14 19:49:17 +02:00
|
|
|
# to install some preconfiguration for GNOME2
|
2006-12-27 12:49:58 +01:00
|
|
|
# and some variables to check.
|
|
|
|
#
|
2007-04-06 00:16:55 +02:00
|
|
|
# For feedback on this script please use
|
|
|
|
# https://bugzilla.novell.com/
|
2006-12-27 12:49:58 +01:00
|
|
|
#
|
2007-04-06 00:16:55 +02:00
|
|
|
|
2008-04-14 19:49:17 +02:00
|
|
|
# openSUSE <= 10.3 and SLED <= 10 modified the user GConf database to change background.
|
|
|
|
# New openSUSE obsoletes this mechanism by branding and gnome-wp-list.
|
|
|
|
# We still have to detect old modifications in the user database and remove them.
|
|
|
|
#
|
|
|
|
# This code may disappear after SLED 12:
|
2007-04-06 00:16:55 +02:00
|
|
|
OLD_WALLPAPER=$(gconftool-2 --get /desktop/gnome/background/picture_filename 2>/dev/null)
|
2007-09-13 18:44:25 +02:00
|
|
|
PICTURE_OPTIONS=$(gconftool-2 --get /desktop/gnome/background/picture_options 2>/dev/null)
|
|
|
|
if [ "$PICTURE_OPTIONS" != "none" -a \(\
|
|
|
|
"$OLD_WALLPAPER" != "${OLD_WALLPAPER#/usr/share/wallpapers/default}" -o ! -e "$OLD_WALLPAPER" \) ] ; then
|
2008-04-14 19:49:17 +02:00
|
|
|
gconftool-2 -u /desktop/gnome/background/picture_filename
|
|
|
|
gconftool-2 -u /desktop/gnome/background/picture_options
|
2006-12-27 12:49:58 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
function use_sled10_default {
|
2008-04-14 19:49:17 +02:00
|
|
|
# do this only for SLED *
|
|
|
|
([ -e /etc/SuSE-release ] && grep "SUSE Linux Enterprise Desktop" /etc/SuSE-release) || return
|
2007-04-06 00:16:55 +02:00
|
|
|
|
|
|
|
# do this only one time
|
|
|
|
[ -e $HOME/.skel/sled10-run ] && return
|
|
|
|
|
|
|
|
# dump the existing config for backup
|
|
|
|
PANEL_BACKUP=panel-settings-backup-`date '+%m%d%y%H%M%S'`.xml
|
|
|
|
gconftool-2 --dump /apps/panel > $PANEL_BACKUP
|
|
|
|
|
|
|
|
# unset the current panel configuration
|
|
|
|
gconftool-2 --recursive-unset /apps/panel/default_setup
|
|
|
|
gconftool-2 --unset /apps/panel/general/toplevel_id_list
|
|
|
|
gconftool-2 --unset /apps/panel/general/applet_id_list
|
|
|
|
gconftool-2 --unset /apps/panel/general/object_id_list
|
|
|
|
gconftool-2 --recursive-unset /apps/panel/profiles/default
|
|
|
|
gconftool-2 --recursive-unset /apps/panel/toplevels
|
|
|
|
gconftool-2 --unset /apps/metacity/general/num_workspaces
|
|
|
|
|
|
|
|
# we are done, set the flag
|
|
|
|
touch ~/.skel/sled10-run
|
2006-12-27 12:49:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# start up the gnome2 session
|
|
|
|
|
2008-04-14 19:49:17 +02:00
|
|
|
# reset the SLED 10 UI only if upgrading from NLD9/SLES9, anything newer we
|
2006-12-27 12:49:58 +01:00
|
|
|
# ignore (like SL 9.3), the logic here is redundant but its low risk
|
2007-04-06 00:16:55 +02:00
|
|
|
# Remove this code after SLED11:
|
|
|
|
mkdir -p $HOME/.skel
|
2006-12-27 12:49:58 +01:00
|
|
|
TRY_SLED10=1
|
|
|
|
if [ ! -e $HOME/.skel/gnome2-run ] || [ -e $HOME/.skel/gnome2-run-9.2 ] ; then
|
|
|
|
TRY_SLED10=0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $TRY_SLED10 -gt 0 ] ; then
|
2008-04-14 19:49:17 +02:00
|
|
|
use_sled10_default
|
2006-12-27 12:49:58 +01:00
|
|
|
else
|
|
|
|
touch ~/.skel/sled10-run
|
|
|
|
fi
|
|
|
|
|
2007-09-20 14:00:26 +02:00
|
|
|
# Install the live install desktop icon this way until there is
|
|
|
|
# a better solution. The actual files reside in gnome2-SuSE
|
2008-04-17 16:41:19 +02:00
|
|
|
# the /usr/share/applications/YaST2/live-installer.desktop exists on a live install system
|
|
|
|
if [ -e /usr/share/applications/YaST2/live-installer.desktop ] ; then
|
2007-09-20 14:00:26 +02:00
|
|
|
mkdir -p ~/Desktop
|
2008-04-29 23:28:26 +02:00
|
|
|
cp -u /usr/share/applications/YaST2/live-installer.desktop ~/Desktop
|
2007-09-21 15:22:36 +02:00
|
|
|
|
2009-03-20 20:21:30 +01:00
|
|
|
# setup live install to not start beagled
|
2007-09-21 15:22:36 +02:00
|
|
|
if [ -e /etc/xdg/autostart/beagled-autostart.desktop ] ; then
|
|
|
|
mkdir -p ~/.config/autostart
|
|
|
|
cp /etc/xdg/autostart/beagled-autostart.desktop ~/.config/autostart
|
|
|
|
echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/beagled-autostart.desktop
|
|
|
|
fi
|
|
|
|
|
2009-03-20 20:21:30 +01:00
|
|
|
# setup live install to not start updater-applet
|
2008-05-24 11:14:50 +02:00
|
|
|
if [ -e /usr/share/gnome/autostart/gpk-update-icon.desktop ] ; then
|
2007-09-21 15:22:36 +02:00
|
|
|
mkdir -p ~/.config/autostart
|
2008-05-24 11:14:50 +02:00
|
|
|
cp /usr/share/gnome/autostart/gpk-update-icon.desktop ~/.config/autostart
|
|
|
|
echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/gpk-update-icon.desktop
|
2007-09-21 15:22:36 +02:00
|
|
|
fi
|
2007-09-20 14:00:26 +02:00
|
|
|
fi
|
|
|
|
|
2007-04-06 00:16:55 +02:00
|
|
|
# Uncomment after SLED12, remove after SLED14:
|
|
|
|
#rm -f ~/.skel/gnome2-run ~/.skel/gnome2-run-9.2 ~/.skel/sled10-run
|
2006-12-27 12:49:58 +01:00
|
|
|
|
2008-06-03 16:12:58 +02:00
|
|
|
# TODO: look for a better fix for 11.1
|
|
|
|
export SDL_AUDIODRIVER=pulse
|
2008-06-05 17:27:49 +02:00
|
|
|
if test -f /etc/alsa-pulse.conf ; then
|
|
|
|
export ALSA_CONFIG_PATH=/etc/alsa-pulse.conf
|
|
|
|
fi
|
2008-06-03 16:12:58 +02:00
|
|
|
|
2007-01-08 13:58:47 +01:00
|
|
|
exec /usr/bin/gnome-session
|