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
|
|
|
|
2011-02-21 23:57:49 +01:00
|
|
|
if test "x$XDG_CONFIG_HOME" = "x"; then
|
|
|
|
XDG_CONFIG_HOME="$HOME/.config"
|
|
|
|
fi
|
|
|
|
SUSE_DIR="$XDG_CONFIG_HOME/suse"
|
|
|
|
|
|
|
|
if test -e /usr/share/applications/YaST2/live-installer.desktop; then
|
|
|
|
IS_LIVE_IMAGE="yes"
|
|
|
|
else
|
|
|
|
IS_LIVE_IMAGE="no"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# We also need to fix the case where the user explicitly configured the
|
|
|
|
# background to what used to be the default background; for openSUSE <= 11.3,
|
|
|
|
# the filename was specific to each version of openSUSE.
|
|
|
|
if test "$IS_LIVE_IMAGE" != "yes" -a ! -f "$SUSE_DIR/gnome-11.4-wallpaper-migrated"; then
|
|
|
|
PICTURE_FILENAME=$(gconftool-2 --get --ignore-schema-defaults /desktop/gnome/background/picture_filename 2>/dev/null)
|
|
|
|
PICTURE_OPTIONS=$(gconftool-2 --get --ignore-schema-defaults /desktop/gnome/background/picture_options 2>/dev/null)
|
|
|
|
if test -n "$PICTURE_OPTIONS" -a -n "$PICTURE_FILENAME" -a \
|
|
|
|
"$PICTURE_OPTIONS" != "none" -a \
|
|
|
|
! -e "$PICTURE_FILENAME" -a \( \
|
|
|
|
"$PICTURE_FILENAME" != "${PICTURE_FILENAME#/usr/share/wallpapers/default}" -o \
|
|
|
|
"$PICTURE_FILENAME" = "/usr/share/wallpapers/openSUSE112-1600x1200.png" -o \
|
|
|
|
"$PICTURE_FILENAME" = "/usr/share/backgrounds/daft/daft.xml" -o \
|
|
|
|
"$PICTURE_FILENAME" = "/usr/share/wallpapers/openSUSE113-1600x1200.jpg" -o \
|
|
|
|
"$PICTURE_FILENAME" = "/usr/share/backgrounds/IK/IK.xml" \
|
|
|
|
\); then
|
|
|
|
gconftool-2 --unset /desktop/gnome/background/picture_filename
|
|
|
|
gconftool-2 --unset /desktop/gnome/background/picture_options
|
2010-02-12 14:49:25 +01:00
|
|
|
fi
|
2011-02-21 23:57:49 +01:00
|
|
|
|
|
|
|
mkdir -p -m 0700 "$XDG_CONFIG_HOME"
|
|
|
|
mkdir -p "$SUSE_DIR"
|
|
|
|
touch "$SUSE_DIR/gnome-11.4-wallpaper-migrated"
|
2006-12-27 12:49:58 +01:00
|
|
|
fi
|
|
|
|
|
2009-10-06 01:32:08 +02:00
|
|
|
# Some actions that are specific to the LiveCD
|
2011-02-21 23:57:49 +01:00
|
|
|
if test "$IS_LIVE_IMAGE" = "yes" ; then
|
2009-10-06 01:32:08 +02:00
|
|
|
# Install the live install desktop icon this way until there is a better
|
|
|
|
# solution. The actual files reside in gnome2-SuSE the
|
|
|
|
# /usr/share/applications/YaST2/live-installer.desktop exists on a live
|
|
|
|
# install system
|
|
|
|
if [ -e .config/user-dirs.dirs ]; then
|
|
|
|
. .config/user-dirs.dirs
|
|
|
|
else
|
|
|
|
XDG_DESKTOP_DIR="$HOME/Desktop"
|
|
|
|
fi
|
|
|
|
mkdir -p $XDG_DESKTOP_DIR
|
|
|
|
cp -u /usr/share/applications/YaST2/live-installer.desktop $XDG_DESKTOP_DIR/
|
|
|
|
|
|
|
|
# setup live install to not have a lock-enabled screensaver
|
|
|
|
gconftool-2 --set /apps/gnome-screensaver/lock_enabled --type=bool "false"
|
2007-09-21 15:22:36 +02:00
|
|
|
|
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
|
|
|
|
2010-06-14 12:58:14 +02:00
|
|
|
# Use gnome-applications.menu instead of applications.menu: its
|
|
|
|
# structure is more appropriate.
|
|
|
|
export XDG_MENU_PREFIX=gnome-
|
|
|
|
|
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
|