[19246] | 1 | #!/bin/bash -e |
---|
| 2 | # Convert GNOME 1 conf files to GNOME 2 GConf keys |
---|
| 3 | # Copyright (C) 2002 Christian Marillat <marillat.christian@wanadoo.fr> |
---|
| 4 | # Copyright (C) 2002 Colin Walters <walters@debian.org> |
---|
| 5 | # $Id: gnome-stuff-1-to-2,v 1.1 2003-04-20 01:41:46 ghudson Exp $ |
---|
| 6 | |
---|
| 7 | DEBIAN_ADD_UPGRADE_CHECK="false" |
---|
| 8 | for arg in "$@";do |
---|
| 9 | if [ "$arg" = "--add-debian-upgrade-check" ]; then |
---|
| 10 | DEBIAN_ADD_UPGRADE_CHECK="true" |
---|
| 11 | fi |
---|
| 12 | done |
---|
| 13 | |
---|
| 14 | gconftool () { |
---|
| 15 | type="$1" |
---|
| 16 | key="$2" |
---|
| 17 | value="$3" |
---|
| 18 | if ! echo "$value" | iconv -f UTF-8 -t UTF-8 1>/dev/null 2>&1; then |
---|
| 19 | echo "\"$value\" is not valid UTF-8, ignoring" |
---|
| 20 | return |
---|
| 21 | fi |
---|
| 22 | echo "running: gconftool-2 -t $type -s $key -- $value" |
---|
| 23 | gconftool-2 -t "$type" -s "$key" -- "$value" |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | # Move all files in ~/.gnome/ to ~/.gnome2 |
---|
| 27 | if [ ! -d ~/.gnome2 ]; then |
---|
| 28 | mkdir ~/.gnome2 |
---|
| 29 | fi |
---|
| 30 | |
---|
| 31 | cp -r ~/.gnome/* ~/.gnome2/ |
---|
| 32 | # Remove cruft |
---|
| 33 | rm -f ~/.gnome2/.gnome-smproxy* |
---|
| 34 | |
---|
| 35 | # Parse gnome general config 1.4 |
---|
| 36 | GNOME_CONFIG_FILE=~/.gnome/Gnome |
---|
| 37 | |
---|
| 38 | if [ -e "$GNOME_CONFIG_FILE" ]; then |
---|
| 39 | printf "Gnome global options file found\n" |
---|
| 40 | GG_TERMINAL=`grep 'Terminal=' $GNOME_CONFIG_FILE | cut -f2 -d'=' | cut -f1 -d' '` |
---|
| 41 | GG_EXEC=`grep 'Terminal=' $GNOME_CONFIG_FILE | cut -f2 -d'=' | cut -f2 -d' '` |
---|
| 42 | |
---|
| 43 | # desktop_gnome_applications_terminal.schemas |
---|
| 44 | test -n "$GG_TERMINAL" && gconftool string "/desktop/gnome/applications/terminal/exec" "$GG_TERMINAL" |
---|
| 45 | test -n "$GG_EXEC" && gconftool string "/desktop/gnome/applications/terminal/exec_arg" "$GG_EXEC" |
---|
| 46 | GG_DEFAULT_SHOW=`grep -w default-show $GNOME_CONFIG_FILE | cut -f2 -d'=' | cut -f1 -d' '` |
---|
| 47 | GG_NEEDS_TERM=false |
---|
| 48 | GG_NREMOTE=false |
---|
| 49 | |
---|
| 50 | if [ "$GG_DEFAULT_SHOW" = "gnome-moz-remote" ]; then |
---|
| 51 | if [ -e ~/.gnome/gnome-moz-remote ]; then |
---|
| 52 | GG_DEFAULT_SHOW=`grep -w filename ~/.gnome/gnome-moz-remote | cut -f2 -d'='` |
---|
| 53 | GG_NEEDS_TERM=`grep -w NEEDS_TERM ~/.gnome/gnome-moz-remote | cut -f2 -d'='` |
---|
| 54 | GG_NREMOTE=`grep -w NREMOTE ~/.gnome/gnome-moz-remote | cut -f2 -d'='` |
---|
| 55 | fi |
---|
| 56 | fi |
---|
| 57 | |
---|
| 58 | # desktop_gnome_applications_browser.schemas |
---|
| 59 | test -n "$GG_DEFAULT_SHOW" && gconftool string "/schemas/desktop/gnome/applications/browser/exec" "$GG_DEFAULT_SHOW" |
---|
| 60 | test -n "$GG_NEEDS_TERM" && gconftool bool "/desktop/gnome/applications/browser/needs_term" "$GG_NEEDS_TERM" |
---|
| 61 | test -n "$GG_NREMOTE" && gconftool bool "/desktop/gnome/applications/browser/nremote" "$GG_NREMOTE" |
---|
| 62 | |
---|
| 63 | GG_GHELP_SHOW=`grep -w ghelp-show $GNOME_CONFIG_FILE | cut -f2 -d'=' | cut -f1 -d' '` |
---|
| 64 | GG_GHELP_TERM=`grep -w GHELP_TERM $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 65 | GG_GHELP_URLS=`grep -w GHELP_URLS $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 66 | |
---|
| 67 | # desktop_gnome_applications_help_viewer.schemas |
---|
| 68 | test -n "$GG_GHELP_SHOW" && gconftool string "/desktop/gnome/applications/help_viewer/exec" "$GG_GHELP_SHOW" |
---|
| 69 | test -n "$GG_GHELP_TERM" && gconftool bool "/desktop/gnome/applications/help_viewer/needs_term" "$GG_GHELP_TERM" |
---|
| 70 | test -n "$GG_GHELP_URLS" && gconftool bool "/desktop/gnome/applications/help_viewer/accepts_urls" "$GG_GHELP_URLS" |
---|
| 71 | |
---|
| 72 | GG_MENUS_HAVE_TEAROFF=`grep -w Menus_have_tearoff $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 73 | GG_MENUS_HAVE_ICONS=`grep -w Menus_have_icons $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 74 | GG_MENUBAR_DETACHABLE=`grep -w Menubar_detachable $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 75 | GG_TOOLBAR_DETACHABLE=`grep -w Toolbar_detachable $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 76 | GG_STATUSBAR_METER_ON_RIGHT=`grep -w StatusBar_Meter_on_Right $GNOME_CONFIG_FILE | cut -f2 -d'='` |
---|
| 77 | |
---|
| 78 | # desktop_gnome_interface.schemas |
---|
| 79 | test -n "$GG_MENUS_HAVE_TEAROFF" && gconftool bool "/desktop/gnome/interface/menus_have_tearoff" "$GG_MENUS_HAVE_TEAROFF" |
---|
| 80 | test -n "$GG_MENUS_HAVE_ICONS" && gconftool bool "/desktop/gnome/interface/menus_have_icons" "$GG_MENUS_HAVE_ICONS" |
---|
| 81 | test -n "$GG_MENUBAR_DETACHABLE" && gconftool bool "/desktop/gnome/interface/menubar_detachable" "$GG_MENUBAR_DETACHABLE" |
---|
| 82 | test -n "$GG_TOOLBAR_DETACHABLE" && gconftool bool "/desktop/gnome/interface/toolbar_detachable" "$GG_TOOLBAR_DETACHABLE" |
---|
| 83 | test -n "$GG_STATUSBAR_METER_ON_RIGHT" && gconftool bool "/desktop/gnome/interface/status_bar_meter_on_right" "$GG_STATUSBAR_METER_ON_RIGHT" |
---|
| 84 | |
---|
| 85 | printf "Done.\n" |
---|
| 86 | else |
---|
| 87 | printf "Gnome global options file not found\n" |
---|
| 88 | fi |
---|
| 89 | |
---|
| 90 | GNOME_SOUND_FILE=~/.gnome/sound/system |
---|
| 91 | |
---|
| 92 | if [ -e "$GNOME_SOUND_FILE" ]; then |
---|
| 93 | printf "Gnome sound options file found\n" |
---|
| 94 | |
---|
| 95 | GS_START_ESD=`grep -w start_esd $GNOME_SOUND_FILE | cut -f2 -d'='` |
---|
| 96 | GS_EVENT_SOUNDS=`grep -w event_sounds $GNOME_SOUND_FILE | cut -f2 -d'='` |
---|
| 97 | |
---|
| 98 | # desktop_gnome_sound.schemas |
---|
| 99 | test -n "$GS_START_ESD" && gconftool bool "/desktop/gnome/sound/enable_esd" "$GS_START_ESD" |
---|
| 100 | test -n "$GS_EVENT_SOUNDS" && gconftool bool "/desktop/gnome/sound/event_sounds" "$GS_EVENT_SOUNDS" |
---|
| 101 | |
---|
| 102 | printf "Done.\n" |
---|
| 103 | else |
---|
| 104 | printf "Gnome sound options file not found\n" |
---|
| 105 | fi |
---|
| 106 | |
---|
| 107 | GNOME_MOUSE_FILE=~/.gnome/Desktop |
---|
| 108 | |
---|
| 109 | if [ -e "$GNOME_MOUSE_FILE" ]; then |
---|
| 110 | printf "Gnome mouse options file found\n" |
---|
| 111 | |
---|
| 112 | GM_ACCELERATION=`grep -w acceleration $GNOME_MOUSE_FILE | cut -f2 -d'='` |
---|
| 113 | GM_THRESHOLD=`grep -w threshold $GNOME_MOUSE_FILE | cut -f2 -d'='` |
---|
| 114 | GM_RIGHT_TO_LEFT=`grep -w right-to-left $GNOME_MOUSE_FILE | cut -f2 -d'='` |
---|
| 115 | |
---|
| 116 | # desktop_gnome_peripherals_mouse.schemas |
---|
| 117 | test -n "$GM_ACCELERATION" && gconftool float "/desktop/gnome/peripherals/mouse/motion_acceleration" "$GM_ACCELERATION" |
---|
| 118 | test -n "$GM_THRESHOLD" && gconftool int "/desktop/gnome/peripherals/mouse/motion_threshold" "$GM_THRESHOLD" |
---|
| 119 | test -n "$GM_RIGHT_TO_LEFT" && gconftool bool "/desktop/gnome/peripherals/mouse/left_handed" "$GM_RIGHT_TO_LEFT" |
---|
| 120 | |
---|
| 121 | printf "Done.\n" |
---|
| 122 | else |
---|
| 123 | printf "Gnome mouse options file not found\n" |
---|
| 124 | fi |
---|
| 125 | |
---|
| 126 | GNOME_KEYBOARD_FILE=~/.gnome/Desktop |
---|
| 127 | |
---|
| 128 | if [ -e "$GNOME_KEYBOARD_FILE" ]; then |
---|
| 129 | printf "Gnome keyboard options file found\n" |
---|
| 130 | |
---|
| 131 | GK_REPEAT=`grep -w repeat $GNOME_KEYBOARD_FILE | cut -f2 -d'='` |
---|
| 132 | GK_DELAY=`grep -w delay $GNOME_KEYBOARD_FILE | cut -f2 -d'='` |
---|
| 133 | GK_RATE=`grep -w rate $GNOME_KEYBOARD_FILE | cut -f2 -d'='` |
---|
| 134 | GK_CLICK=`grep -w click $GNOME_KEYBOARD_FILE | cut -f2 -d'='` |
---|
| 135 | GK_CLICKVOLUME=`grep -w clickvolume $GNOME_KEYBOARD_FILE | cut -f2 -d'='` |
---|
| 136 | |
---|
| 137 | # desktop_gnome_peripherals_keyboard.schemas |
---|
| 138 | test -n "$GK_REPEAT" && gconftool bool "/desktop/gnome/peripherals/keyboard/repeat" "$GK_REPEAT" |
---|
| 139 | test -n "$GK_DELAY" && gconftool int "/desktop/gnome/peripherals/keyboard/delay" "$GK_DELAY" |
---|
| 140 | test -n "$GK_RATE" && gconftool int "/desktop/gnome/peripherals/keyboard/rate" "$GK_RATE" |
---|
| 141 | test -n "$GK_CLICK" && gconftool bool "/desktop/gnome/peripherals/keyboard/click" "$GK_CLICK" |
---|
| 142 | test -n "$GK_CLICKVOLUME" && gconftool int "/desktop/gnome/peripherals/keyboard/click_volume" "$GK_CLICKVOLUME" |
---|
| 143 | |
---|
| 144 | printf "Done.\n" |
---|
| 145 | else |
---|
| 146 | printf "Gnome keyboard options file not found\n" |
---|
| 147 | fi |
---|
| 148 | |
---|
| 149 | GNOME_BACKGROUND_FILE=~/.gnome/Background |
---|
| 150 | |
---|
| 151 | if [ -e "$GNOME_BACKGROUND_FILE" ]; then |
---|
| 152 | printf "Gnome background options file found\n" |
---|
| 153 | |
---|
| 154 | GB_COLOR1=`grep -w color1 $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 155 | GB_COLOR2=`grep -w color2 $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 156 | GB_OPACITY=`grep -w opacity $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 157 | GB_ENABLED=`grep -w Enabled $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 158 | GB_GRADIENT=`grep -w gradient $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 159 | GB_WALLPAPER=`grep -w wallpaper $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 160 | |
---|
| 161 | GB_WALLPAPERALIGN=`grep -w wallpaperAlign $GNOME_BACKGROUND_FILE | cut -f2 -d'='` |
---|
| 162 | case "$GB_WALLPAPERALIGN" in |
---|
| 163 | 1) GB_WALLPAPERALIGN=centered ;; |
---|
| 164 | 2) GB_WALLPAPERALIGN=stretched ;; |
---|
| 165 | 3) GB_WALLPAPERALIGN=scaled ;; |
---|
| 166 | *) GB_WALLPAPERALIGN=centered ;; |
---|
| 167 | esac |
---|
| 168 | |
---|
| 169 | # desktop_gnome_background.schemas |
---|
| 170 | test -n "$GB_COLOR1" && gconftool string "/desktop/gnome/background/primary_color" "$GB_COLOR1" |
---|
| 171 | test -n "$GB_COLOR2" && gconftool string "/desktop/gnome/background/secondary_color" "$GB_COLOR2" |
---|
| 172 | test -n "$GB_OPACITY" && gconftool int "/desktop/gnome/background/picture_opacity" "$GB_OPACITY" |
---|
| 173 | test -n "$GB_ENABLED" && gconftool bool "/desktop/gnome/background/draw_background" "$GB_ENABLED" |
---|
| 174 | test -n "$GB_WALLPAPERALIGN" && gconftool string "/desktop/gnome/background/picture_options" "$GB_WALLPAPERALIGN" |
---|
| 175 | test -n "$GB_GRADIENT" && gconftool string "/desktop/gnome/background/color_shading_type" "$GB_GRADIENT""-gradient" |
---|
| 176 | test -n "$GB_WALLPAPER" && gconftool string "/desktop/gnome/background/picture_filename" "$GB_WALLPAPER" |
---|
| 177 | |
---|
| 178 | printf "Done.\n" |
---|
| 179 | else |
---|
| 180 | printf "Gnome background options file not found\n" |
---|
| 181 | fi |
---|
| 182 | |
---|
| 183 | GNOME_WM_FILE=~/.gnome/default.wm |
---|
| 184 | |
---|
| 185 | if [ -e "$GNOME_WM_FILE" ]; then |
---|
| 186 | printf "Gnome window-manager options file found\n" |
---|
| 187 | |
---|
| 188 | GWM=`grep -w WM $GNOME_WM_FILE | cut -f2 -d'='` |
---|
| 189 | |
---|
| 190 | # desktop_gnome_peripherals_mouse.schemas |
---|
| 191 | test $GWM != "" && gconftool string "/desktop/gnome/applications/window_manager/current" "$GWM" |
---|
| 192 | |
---|
| 193 | printf "Done.\n" |
---|
| 194 | else |
---|
| 195 | printf "Gnome window-manager options file not found\n" |
---|
| 196 | fi |
---|
| 197 | |
---|
| 198 | # Parse gnome-panel (global) 1.4 config |
---|
| 199 | |
---|
| 200 | GP_CONFIG_FILE=~/.gnome/panel |
---|
| 201 | |
---|
| 202 | if [ -e "$GP_CONFIG_FILE" ]; then |
---|
| 203 | printf "Gnome-panel options file found\n" |
---|
| 204 | GP_TOOLTIPS_ENABLED=`grep -w tooltips_enabled $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 205 | GP_DISABLE_ANIMATIONS=`grep -w disable_animations $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 206 | if [ $GP_DISABLE_ANIMATIONS = "true" ]; then |
---|
| 207 | GP_DISABLE_ANIMATIONS=false |
---|
| 208 | else |
---|
| 209 | GP_DISABLE_ANIMATIONS=true |
---|
| 210 | fi |
---|
| 211 | |
---|
| 212 | GP_MINIMIZED_SIZE=`grep -w minimized_size $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 213 | GP_MAXIMIZE_DELAY=`grep -w maximize_delay $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 214 | GP_MINIMIZE_DELAY=`grep -w minimize_delay $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 215 | GP_MENU_KEY=`grep -w menu_key $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 216 | GP_RUN_KEY=`grep -w run_key $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 217 | GP_SCREENSHOT_KEY=`grep -w screenshot_key $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 218 | GP_WINDOW_SCREENSHOT_KEY=`grep -w window_screenshot_key $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 219 | GP_DRAWER_AUTO_CLOSE=`grep -w drawer_auto_close $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 220 | GP_CONFIRM_PANEL_REMOVE=`grep -w confirm_panel_remove $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 221 | GP_MEMORY_HUNGRY_MENUS=`grep -w memory_hungry_menus $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 222 | GP_SATURATE_WHEN_OVER=`grep -w saturate_when_over $GP_CONFIG_FILE | cut -f2 -d'='` |
---|
| 223 | |
---|
| 224 | # Set gnome-panel 2 configuration |
---|
| 225 | # panel-global-config.schemas |
---|
| 226 | test -n "$GP_CONFIRM_PANEL_REMOVE" && gconftool bool "/apps/panel/global/confirm_panel_remove" "$GP_CONFIRM_PANEL_REMOVE" |
---|
| 227 | test -n "$GP_DRAWER_AUTO_CLOSE" && gconftool bool "/apps/panel/global/drawer_autoclose" "$GP_DRAWER_AUTO_CLOSE" |
---|
| 228 | test -n "$GP_DISABLE_ANIMATIONS" && gconftool bool "/apps/panel/global/enable_animations" "$GP_DISABLE_ANIMATIONS" |
---|
| 229 | test -n "$GP_SATURATE_WHEN_OVER" && gconftool bool "/apps/panel/global/highlight_launchers_on_mouseover" "$GP_SATURATE_WHEN_OVER" |
---|
| 230 | test -n "$GP_MEMORY_HUNGRY_MENUS" && gconftool bool "/apps/panel/global/keep_menus_in_memory" "$GP_MEMORY_HUNGRY_MENUS" |
---|
| 231 | test -n "$GP_TOOLTIPS_ENABLED" && gconftool bool "/apps/panel/global/tooltips_enabled" "$GP_TOOLTIPS_ENABLED" |
---|
| 232 | test -n "$GP_MINIMIZE_DELAY" && gconftool int "/apps/panel/global/panel_hide_delay" "$GP_MINIMIZE_DELAY" |
---|
| 233 | test -n "$GP_MINIMIZED_SIZE" && gconftool int "/apps/panel/global/panel_minimized_size" "$GP_MINIMIZED_SIZE" |
---|
| 234 | test -n "$GP_MAXIMIZE_DELAY" && gconftool int "/apps/panel/global/panel_show_delay" "$GP_MAXIMIZE_DELAY" |
---|
| 235 | test -n "$GP_MENU_KEY" && gconftool string "/apps/panel/global/menu_key" "$GP_MENU_KEY" |
---|
| 236 | test -n "$GP_RUN_KEY" && gconftool string "/apps/panel/global/run_key" "$GP_RUN_KEY" |
---|
| 237 | test -n "$GP_SCREENSHOT_KEY" && gconftool string "/apps/panel/global/screenshot_key" "$GP_SCREENSHOT_KEY" |
---|
| 238 | test -n "$GP_WINDOW_SCREENSHOT_KEY" && gconftool string "/apps/panel/global/window_screenshot_key" "$GP_WINDOW_SCREENSHOT_KEY" |
---|
| 239 | |
---|
| 240 | printf "Done.\n" |
---|
| 241 | else |
---|
| 242 | printf "Gnome-panel panel options file not found\n" |
---|
| 243 | fi |
---|
| 244 | |
---|
| 245 | # Parse gnome-session 1.4 config |
---|
| 246 | GSS_CONFIG_FILE=~/.gnome/session |
---|
| 247 | |
---|
| 248 | if [ -e "$GSS_CONFIG_FILE" ]; then |
---|
| 249 | printf "Gnome-session options file found.\n" |
---|
| 250 | GS_AUTOSAVE=`grep -w AutoSave $GSS_CONFIG_FILE | cut -f2 -d'='` |
---|
| 251 | GS_LOGOUTPROMPT=`grep -w LogoutPrompt $GSS_CONFIG_FILE | cut -f2 -d'='` |
---|
| 252 | GS_SPLASHSCREEN=`grep -w SplashScreen $GSS_CONFIG_FILE | cut -f2 -d'='` |
---|
| 253 | |
---|
| 254 | # Set gnome-session 2 configuration |
---|
| 255 | test -n "$GS_AUTOSAVE" && gconftool bool "/apps/gnome-session/options/auto_save_session" "$GS_AUTOSAVE" |
---|
| 256 | test -n "$GS_LOGOUTPROMPT" && gconftool bool "/apps/gnome-session/options/logout_prompt" "$GS_LOGOUTPROMPT" |
---|
| 257 | test -n "$GS_SPLASHSCREEN" && gconftool bool "/apps/gnome-session/options/show_splash_screen" "$GS_SPLASHSCREEN" |
---|
| 258 | |
---|
| 259 | # First remove the one copied before |
---|
| 260 | rm ~/.gnome2/session |
---|
| 261 | |
---|
| 262 | # Which session ? |
---|
| 263 | GS_SESSION=`grep -w "Current Session" $GSS_CONFIG_FILE | cut -f2 -d'='` |
---|
| 264 | |
---|
| 265 | # If not defined use Default |
---|
| 266 | if [ -z "$GS_SESSION" ]; then |
---|
| 267 | GS_SESSION="Default" |
---|
| 268 | fi |
---|
| 269 | |
---|
| 270 | # Position of the Default string to do a tail instead a cat |
---|
| 271 | GS_SESSION_POS=`grep -n -w "\["$GS_SESSION"\]" $GSS_CONFIG_FILE | cut -f1 -d':'` |
---|
| 272 | |
---|
| 273 | # Load session file |
---|
| 274 | array=(`tail +$GS_SESSION_POS $GSS_CONFIG_FILE`) |
---|
| 275 | elements=${#array[*]} |
---|
| 276 | index=0 |
---|
| 277 | |
---|
| 278 | while [ "$index" -lt "$elements" ] |
---|
| 279 | do |
---|
| 280 | # Number of clients |
---|
| 281 | if [ `echo ${array[$index]} | grep -w "\["$GS_SESSION"\]"` ]; then |
---|
| 282 | while [ "$index" -lt "$elements" ] |
---|
| 283 | do |
---|
| 284 | GS_CLIENTS=`echo ${array[$index]} | grep -w num_clients | cut -f2 -d'='` |
---|
| 285 | let "index += 1" |
---|
| 286 | done |
---|
| 287 | fi |
---|
| 288 | let "index += 1" |
---|
| 289 | done |
---|
| 290 | |
---|
| 291 | count=0 |
---|
| 292 | index=0 |
---|
| 293 | found_default="" |
---|
| 294 | |
---|
| 295 | while [ "$count" -lt "$GS_CLIENTS" ] |
---|
| 296 | do |
---|
| 297 | index=0 |
---|
| 298 | while [ "$index" -lt "$elements" ] |
---|
| 299 | do |
---|
| 300 | if [ ${array[$index]} = "["$GS_SESSION"]" ] || [ -n "$found_default" ]; then |
---|
| 301 | found_default=TRUE |
---|
| 302 | if [ `echo ${array[$index]} | grep $count",Program="` ]; then |
---|
| 303 | while [ "$index" -lt "$elements" ] |
---|
| 304 | do |
---|
| 305 | if [ `echo ${array[$index]} | egrep -v "properties|xscreensaver-demo"` ]; then |
---|
| 306 | skip[$count]=TRUE |
---|
| 307 | let "count += 1" |
---|
| 308 | break |
---|
| 309 | else |
---|
| 310 | skip[$count]=FALSE |
---|
| 311 | let "count += 1" |
---|
| 312 | break |
---|
| 313 | fi |
---|
| 314 | done |
---|
| 315 | fi |
---|
| 316 | fi |
---|
| 317 | let "index += 1" |
---|
| 318 | done |
---|
| 319 | let "count += 1" |
---|
| 320 | done |
---|
| 321 | |
---|
| 322 | found_default="" |
---|
| 323 | |
---|
| 324 | printf "[Default]\n" > ~/.gnome2/session |
---|
| 325 | elements=${#skip[*]} |
---|
| 326 | count=0 |
---|
| 327 | index=0 |
---|
| 328 | found_default="" |
---|
| 329 | |
---|
| 330 | for (( session = 0; session < $elements; session++ )) |
---|
| 331 | do |
---|
| 332 | if [ ${skip[$session]} = TRUE ]; then |
---|
| 333 | tail +$GS_SESSION_POS $GSS_CONFIG_FILE | grep $session, | sed -e s/$session/$count/ >> ~/.gnome2/session |
---|
| 334 | let "count += 1" |
---|
| 335 | fi |
---|
| 336 | done |
---|
| 337 | if [ -n "$DEBIAN_ADD_UPGRADE_CHECK" ]; then |
---|
| 338 | cat >> ~/.gnome2/session <<EOF |
---|
| 339 | $count,id=debiangnomeupgrade666666 |
---|
| 340 | $count,Priority=50 |
---|
| 341 | $count,RestartCommand=debian-gnome-upgrade-check --sm-client-id debiangnomeupgrade666666 |
---|
| 342 | $count,RestartStyleHint=1 |
---|
| 343 | EOF |
---|
| 344 | let "count += 1" |
---|
| 345 | fi |
---|
| 346 | printf "num_clients="$count"\n" >> ~/.gnome2/session |
---|
| 347 | |
---|
| 348 | # Rename panel in gnome-panel |
---|
| 349 | perl -i -pe 's,=panel,=gnome-panel,' ~/.gnome2/session |
---|
| 350 | perl -i -pe 's,=/usr/bin/panel,=gnome-panel,' ~/.gnome2/session |
---|
| 351 | # Use nautilus instead of gmc |
---|
| 352 | perl -i -pe 's,=/usr/bin/gmc,=nautilus,' ~/.gnome2/session |
---|
| 353 | perl -i -pe 's,=gmc,=nautilus,' ~/.gnome2/session |
---|
| 354 | |
---|
| 355 | # replace ~/ by /home/$user |
---|
| 356 | user_name=`id -un` |
---|
| 357 | perl -i -pe 's,~/,/home/'$user_name',' ~/.gnome2/session |
---|
| 358 | |
---|
| 359 | printf "Done.\n" |
---|
| 360 | else |
---|
| 361 | printf "Gnome-session options file not found.\n" |
---|
| 362 | fi |
---|
| 363 | |
---|
| 364 | # Parse gnome-terminal 1.4 config |
---|
| 365 | GT_CONFIG_FILE=~/.gnome/Terminal |
---|
| 366 | |
---|
| 367 | if [ ! -e ~/.gconf/apps/gnome-terminal/global/%gconf.xml ]; then |
---|
| 368 | if [ -e "$GT_CONFIG_FILE" ]; then |
---|
| 369 | printf "Gnome-terminal configuration file found.\n" |
---|
| 370 | GT_BACKGROUND_PIXMAP=`grep -w background_pixmap $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 371 | GT_BELL_SILENCED=`grep -w bell_silenced $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 372 | GT_BLINKING=`grep -w blinking $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 373 | GT_COLOR_SCHEME=`grep -w color_scheme $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 374 | GT_COLOR_SET=`grep -w color_set $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 375 | GT_DEL_IS_DEL=`grep -w del_is_del $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 376 | GT_KEYBOARD_SECURED=`grep -w keyboard_secured $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 377 | GT_LOGIN_BY_DEFAULT=`grep -w login_by_default $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 378 | GT_MENUBAR=`grep -w menubar $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 379 | GT_PALETTE=`grep -w palette $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 380 | GT_PIXMAP_FILE=`grep -w pixmap_file $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 381 | GT_SCROLL_BACKGROUND=`grep -w scroll_background $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 382 | GT_SCROLLBACKLINES=`grep -w scrollbacklines $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 383 | GT_SCROLLONKEY=`grep -w scrollonkey $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 384 | GT_SCROLLONOUTPUT=`grep -w scrollonoutput $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 385 | GT_SCROLLPOS=`grep -w scrollpos $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 386 | GT_SHADED=`grep -w shaded $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 387 | GT_SWAP_DEL_AND_BACKSPACE=`grep -w swap_del_and_backspace $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 388 | GT_TRANSPARENT=`grep -w transparent $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 389 | GT_USE_BOLD=`grep -w use_bold $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 390 | GT_USE_FONTSET=`grep -w use_fontset $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 391 | GT_WORDCLASS=`grep -w wordclass $GT_CONFIG_FILE | cut -f2 -d'='` |
---|
| 392 | |
---|
| 393 | # Set gnome-terminal 2 configuration |
---|
| 394 | test -n "$GT_USE_BOLD" && gconftool bool "/apps/gnome-terminal/profiles/Default/allow_bold" "$GT_USE_BOLD" |
---|
| 395 | test -n "$GT_BLINKING" && gconftool bool "/apps/gnome-terminal/profiles/Default/cursor_blink" "$GT_BLINKING" |
---|
| 396 | test -n "$GT_MENUBAR" && gconftool bool "/apps/gnome-terminal/profiles/Default/default_show_menubar" "$GT_MENUBAR" |
---|
| 397 | test -n "$GT_LOGIN_BY_DEFAULT" && gconftool bool "/apps/gnome-terminal/profiles/Default/login_shell" "$GT_LOGIN_BY_DEFAULT" |
---|
| 398 | test -n "$GT_SCROLL_BACKGROUND" && gconftool bool "/apps/gnome-terminal/profiles/Default/scroll_background" "$GT_SCROLL_BACKGROUND" |
---|
| 399 | test -n "$GT_SCROLLONKEY" && gconftool bool "/apps/gnome-terminal/profiles/Default/scroll_on_keystroke" "$GT_SCROLLONKEY" |
---|
| 400 | test -n "$GT_SCROLLONOUTPUT" && gconftool bool "/apps/gnome-terminal/profiles/Default/scroll_on_output" "$GT_SCROLLONOUTPUT" |
---|
| 401 | test -n "$GT_BELL_SILENCED" && gconftool bool "/apps/gnome-terminal/profiles/Default/silent_bell" "$GT_BELL_SILENCED" |
---|
| 402 | test -n "$GT_USE_FONTSET" && gconftool bool "/apps/gnome-terminal/profiles/Default/use_system_font" "$GT_USE_FONTSET" |
---|
| 403 | test -n "$GT_SCROLLBACKLINES" && gconftool int "/apps/gnome-terminal/profiles/Default/scrollback_lines" "$GT_SCROLLBACKLINES" |
---|
| 404 | test -n "$GT_PIXMAP_FILE" && gconftool string "/apps/gnome-terminal/profiles/Default/background_image" "$GT_PIXMAP_FILE" |
---|
| 405 | test -n "$GT_SCROLLPOS" && gconftool string "/apps/gnome-terminal/profiles/Default/scrollbar_position" "$GT_SCROLLPOS" |
---|
| 406 | |
---|
| 407 | if [ "$GT_TRANSPARENT" = "true" ]; then |
---|
| 408 | gconftool string "/apps/gnome-terminal/profiles/Default/background_type" "transparent" |
---|
| 409 | else |
---|
| 410 | gconftool string "/apps/gnome-terminal/profiles/Default/background_type" "solid" |
---|
| 411 | fi |
---|
| 412 | |
---|
| 413 | for GT_COLORS in $GT_PALETTE |
---|
| 414 | do |
---|
| 415 | NEW_GT_COLORS=$NEW_GT_COLORS'#'`expr substr $GT_COLORS 7 2``expr substr $GT_COLORS 12 2``expr substr $GT_COLORS 17 2`':' |
---|
| 416 | done |
---|
| 417 | NEW_GT_COLORS=`echo $NEW_GT_COLORS | cut -f-16 -d':'` |
---|
| 418 | gconftool string "/apps/gnome-terminal/profiles/Default/palette" "$NEW_GT_COLORS" |
---|
| 419 | |
---|
| 420 | printf "Done.\n" |
---|
| 421 | else |
---|
| 422 | printf "Gnome-terminal configuration file not found.\n" |
---|
| 423 | fi |
---|
| 424 | fi |
---|
| 425 | |
---|
| 426 | # Local Variables: |
---|
| 427 | # compile-command: "bash -n gnome-stuff-1-to-2" |
---|
| 428 | # End: |
---|