~jibel/update-manager/AutoUpgradeTester-portlocking

« back to all changes in this revision

Viewing changes to AutoUpgradeTester/prepare_lts_user

  • Committer: Michael Vogt
  • Date: 2012-01-26 08:17:13 UTC
  • mfrom: (2307.1.2 update-manager)
  • Revision ID: michael.vogt@ubuntu.com-20120126081713-m3cy700sg3l0ytzq
mergedĀ lp:~jibel/update-manager/AutoUpgradeTester-desktoptests

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# This script sets some popular user configuration settings in an Ubuntu 10.04
 
3
# LTS GNOME system. Run this, then upgrade to 12.04 LTS (or later), and run
 
4
# test_lts_upgrade_user.py to confirm that settings were migrated properly. In
 
5
# particular this checks for gconf -> gsettings migration (and sometimes
 
6
# changing the format of the values) for popular settings, as well as custom
 
7
# panel/desktop launchers.
 
8
#
 
9
# You need to run this script in a fully running GNOME desktop session.
 
10
 
 
11
#
 
12
# (C) 2012 Canonical Ltd.
 
13
# Author: Martin Pitt <martin.pitt@ubuntu.com>
 
14
# License: GPL v2 or higher
 
15
 
 
16
set -e
 
17
 
 
18
echo "Setting custom background..."
 
19
cp `ls /usr/share/backgrounds/*.jpg | head -n1` $HOME/mybackground.jpg
 
20
gconftool -s /desktop/gnome/background/picture_filename --type string $HOME/mybackground.jpg
 
21
 
 
22
echo "Setting Radiance theme..."
 
23
gconftool -s /desktop/gnome/interface/gtk_theme --type string Radiance
 
24
 
 
25
echo "Adding custom panel launchers..."
 
26
# add launcher for system desktop file (gedit)
 
27
gconftool -s /apps/panel/objects/object_0/menu_path --type string 'applications:/'
 
28
gconftool -s /apps/panel/objects/object_0/launcher_location --type string '/usr/share/applications/gedit.desktop'
 
29
gconftool -s /apps/panel/objects/object_0/bonobo_iid --type string ''
 
30
gconftool -s /apps/panel/objects/object_0/custom_icon --type string ''
 
31
gconftool -s /apps/panel/objects/object_0/locked --type bool false
 
32
gconftool -s /apps/panel/objects/object_0/panel_right_stick --type bool false
 
33
gconftool -s /apps/panel/objects/object_0/object_type --type string 'launcher-object'
 
34
gconftool -s /apps/panel/objects/object_0/use_custom_icon --type bool false
 
35
gconftool -s /apps/panel/objects/object_0/tooltip --type string ''
 
36
gconftool -s /apps/panel/objects/object_0/toplevel_id --type string 'top_panel_screen0'
 
37
gconftool -s /apps/panel/objects/object_0/action_type --type string 'lock'
 
38
gconftool -s /apps/panel/objects/object_0/use_menu_path --type bool false
 
39
gconftool -s /apps/panel/objects/object_0/position --type int 60
 
40
gconftool -s /apps/panel/objects/object_0/attached_toplevel_id --type string ''
 
41
 
 
42
# add launcher for custom desktop file
 
43
mkdir -p $HOME/.gnome2/panel2.d/default/launchers/
 
44
mkdir -p $HOME/Desktop
 
45
 
 
46
cat <<EOF > $HOME/.gnome2/panel2.d/default/launchers/echo-1.desktop
 
47
#!/usr/bin/env xdg-open
 
48
[Desktop Entry]
 
49
Version=1.0
 
50
Type=Application
 
51
Terminal=true
 
52
Icon[en_US]=partner
 
53
Name[en_US]=hello
 
54
Exec=echo hello
 
55
Name=hello
 
56
Icon=gnome-panel-launcher
 
57
EOF
 
58
chmod 755 $HOME/.gnome2/panel2.d/default/launchers/echo-1.desktop
 
59
gconftool -s /apps/panel/objects/object_1/menu_path --type string 'applications:/'
 
60
gconftool -s /apps/panel/objects/object_1/launcher_location --type string 'echo-1.desktop'
 
61
gconftool -s /apps/panel/objects/object_1/bonobo_iid --type string ''
 
62
gconftool -s /apps/panel/objects/object_1/custom_icon --type string ''
 
63
gconftool -s /apps/panel/objects/object_1/locked --type bool false
 
64
gconftool -s /apps/panel/objects/object_1/panel_right_stick --type bool false
 
65
gconftool -s /apps/panel/objects/object_1/object_type --type string 'launcher-object'
 
66
gconftool -s /apps/panel/objects/object_1/use_custom_icon --type bool false
 
67
gconftool -s /apps/panel/objects/object_1/tooltip --type string ''
 
68
gconftool -s /apps/panel/objects/object_1/toplevel_id --type string 'top_panel_screen0'
 
69
gconftool -s /apps/panel/objects/object_1/action_type --type string 'lock'
 
70
gconftool -s /apps/panel/objects/object_1/use_menu_path --type bool false
 
71
gconftool -s /apps/panel/objects/object_1/position --type int 90
 
72
gconftool -s /apps/panel/objects/object_1/attached_toplevel_id --type string ''
 
73
 
 
74
# add the two new launchers to the panel object list
 
75
old_list=`gconftool -g /apps/panel/general/object_id_list | sed 's/]$//'`
 
76
gconftool -s /apps/panel/general/object_id_list --type list --list-type string "$old_list,object_0,object_1]"
 
77
 
 
78
echo "Adding custom desktop launchers ..."
 
79
cat <<EOF > $HOME/Desktop/gucharmap.desktop
 
80
#!/usr/bin/env xdg-open
 
81
[Desktop Entry]
 
82
Name=Character Map
 
83
Comment=Insert special characters into documents
 
84
Exec=gucharmap
 
85
Icon=accessories-character-map
 
86
Terminal=false
 
87
Type=Application
 
88
Categories=GNOME;GTK;Utility;
 
89
X-GNOME-Bugzilla-Bugzilla=GNOME
 
90
X-GNOME-Bugzilla-Product=gucharmap
 
91
X-GNOME-Bugzilla-Component=general
 
92
X-GNOME-Bugzilla-Version=2.30.0
 
93
StartupNotify=true
 
94
X-Ubuntu-Gettext-Domain=gucharmap
 
95
EOF
 
96
chmod 755 $HOME/Desktop/gucharmap.desktop
 
97
 
 
98
cat <<EOF > $HOME/Desktop/termcalc.desktop
 
99
#!/usr/bin/env xdg-open
 
100
 
 
101
[Desktop Entry]
 
102
Version=1.0
 
103
Type=Application
 
104
Terminal=true
 
105
Icon[en_US]=/usr/share/icons/gnome/scalable/apps/calc.svg
 
106
Name[en_US]=termcalc
 
107
Exec=bc -l
 
108
Name=termcalc
 
109
Icon=/usr/share/icons/gnome/scalable/apps/calc.svg
 
110
EOF
 
111
chmod 755 $HOME/Desktop/termcalc.desktop
 
112
 
 
113
echo "Setting custom keyboard layouts..."
 
114
gconftool -s /desktop/gnome/peripherals/keyboard/kbd/layouts --type list --list-type string "[us,de     nodeadkeys,gb,gb        dvorak]"
 
115
 
 
116
echo 'Success. Now upgrade to 12.04 LTS and run test_lts_upgrade_user.py'