home *** CD-ROM | disk | FTP | other *** search
/ tusportal.tus.k12.pa.us / tusportal.tus.k12.pa.us.tar / tusportal.tus.k12.pa.us / Wyse / latest-image.raw / 0.img / usr / bin / gnome < prev    next >
Text File  |  2012-08-08  |  4KB  |  118 lines

  1. #!/bin/bash
  2. #
  3. # This is not the original gnome-session but a start script
  4. # to install some preconfiguration for GNOME2
  5. # and some variables to check.
  6. #
  7. # For feedback on this script please use
  8. # https://bugzilla.novell.com/
  9. #
  10.  
  11. function upgrade_to_sled11 {
  12.     # do this only one time
  13.     [ -e $HOME/.skel/sled11-run ] && return
  14.  
  15.     # openSUSE <= 10.3 and SLED <= 10 modified the user GConf database to change background.
  16.     # New openSUSE obsoletes this mechanism by branding and gnome-wp-list.
  17.     # We still have to detect old modifications in the user database and remove them.
  18.     #
  19.     # This code may disappear after SLED 12:
  20.  
  21.     OLD_WALLPAPER=$(gconftool-2 --get /desktop/gnome/background/picture_filename 2>/dev/null)
  22.     PICTURE_OPTIONS=$(gconftool-2 --get /desktop/gnome/background/picture_options 2>/dev/null)
  23.     if [ "$PICTURE_OPTIONS" != "none" -a \(\
  24.        "$OLD_WALLPAPER" != "${OLD_WALLPAPER#/usr/share/wallpapers/default}" -o ! -e "$OLD_WALLPAPER" \) ] ; then
  25.     gconftool-2 -u /desktop/gnome/background/picture_filename
  26.     gconftool-2 -u /desktop/gnome/background/picture_options
  27.     fi
  28.  
  29.     # we are done, set the flag
  30.     touch ~/.skel/sled11-run
  31. }
  32.  
  33. function use_sled10_default {
  34.     # do this only for SLED *
  35.     ([ -e /etc/SuSE-release ] && grep "SUSE Linux Enterprise Desktop" /etc/SuSE-release) || return
  36.  
  37.     # do this only one time
  38.     [ -e $HOME/.skel/sled10-run ] && return
  39.  
  40.     # dump the existing config for backup
  41.     PANEL_BACKUP=panel-settings-backup-`date '+%m%d%y%H%M%S'`.xml
  42.     gconftool-2 --dump /apps/panel > $PANEL_BACKUP
  43.  
  44.     # unset the current panel configuration
  45.     gconftool-2 --recursive-unset /apps/panel/default_setup
  46.     gconftool-2 --unset /apps/panel/general/toplevel_id_list
  47.     gconftool-2 --unset /apps/panel/general/applet_id_list
  48.     gconftool-2 --unset /apps/panel/general/object_id_list
  49.     gconftool-2 --recursive-unset /apps/panel/profiles/default
  50.     gconftool-2 --recursive-unset /apps/panel/toplevels
  51.     gconftool-2 --unset /apps/metacity/general/num_workspaces
  52.  
  53.     # we are done, set the flag
  54.     touch ~/.skel/sled10-run
  55. }
  56.  
  57. # start up the gnome2 session
  58.  
  59. # reset the SLED 10 UI only if upgrading from NLD9/SLES9, anything newer we
  60. # ignore (like SL 9.3), the logic here is redundant but its low risk
  61. # Remove this code after SLED11:
  62. mkdir -p $HOME/.skel
  63. TRY_SLED10=1
  64. if [ ! -e $HOME/.skel/gnome2-run ] || [ -e $HOME/.skel/gnome2-run-9.2 ] ; then
  65.   TRY_SLED10=0
  66. fi
  67.  
  68. if [ $TRY_SLED10 -gt 0 ] ; then
  69.  use_sled10_default
  70. else
  71.  touch ~/.skel/sled10-run
  72. fi
  73.  
  74. upgrade_to_sled11
  75.  
  76. # Some actions that are specific to the LiveCD
  77. if [ -e /usr/share/applications/YaST2/live-installer.desktop ] ; then
  78.   # Install the live install desktop icon this way until there is a better
  79.   # solution. The actual files reside in gnome2-SuSE the
  80.   # /usr/share/applications/YaST2/live-installer.desktop exists on a live
  81.   # install system
  82.   if [ -e .config/user-dirs.dirs ]; then
  83.     . .config/user-dirs.dirs
  84.   else
  85.     XDG_DESKTOP_DIR="$HOME/Desktop"
  86.   fi
  87.   mkdir -p $XDG_DESKTOP_DIR
  88.   cp -u /usr/share/applications/YaST2/live-installer.desktop $XDG_DESKTOP_DIR/
  89.  
  90.   # setup live install to not have a lock-enabled screensaver
  91.   gconftool-2 --set /apps/gnome-screensaver/lock_enabled --type=bool "false"
  92.  
  93.   # setup live install to not start beagled
  94.   if [ -e /etc/xdg/autostart/beagled-autostart.desktop ] ; then
  95.     mkdir -p ~/.config/autostart
  96.     cp /etc/xdg/autostart/beagled-autostart.desktop ~/.config/autostart
  97.     echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/beagled-autostart.desktop
  98.   fi
  99.  
  100.   # setup live install to not start updater-applet
  101.   if [ -e /usr/share/gnome/autostart/gpk-update-icon.desktop ] ; then
  102.     mkdir -p ~/.config/autostart
  103.     cp /usr/share/gnome/autostart/gpk-update-icon.desktop ~/.config/autostart
  104.     echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/gpk-update-icon.desktop
  105.   fi
  106. fi
  107.  
  108. # Uncomment after SLED12, remove after SLED14:
  109. #rm -f ~/.skel/gnome2-run ~/.skel/gnome2-run-9.2 ~/.skel/sled10-run
  110.  
  111. # TODO: look for a better fix for 11.1
  112. export SDL_AUDIODRIVER=pulse
  113. if test -f /etc/alsa-pulse.conf ; then
  114.   export ALSA_CONFIG_PATH=/etc/alsa-pulse.conf
  115. fi
  116.  
  117. exec dbus-launch thinclient-session
  118.