Merge lp:~sil2100/compiz/gsettings_migration into lp:compiz/0.9.8

Proposed by Łukasz Zemczak on 2012-07-23
Status: Merged
Approved by: Daniel van Vugt on 2012-07-24
Approved revision: 3289
Merged at revision: 3287
Proposed branch: lp:~sil2100/compiz/gsettings_migration
Merge into: lp:compiz/0.9.8
Diff against target: 305 lines (+289/-0)
3 files modified
postinst/convert-files/compiz-profile-Default.convert (+110/-0)
postinst/convert-files/compiz-profile-active-Default.convert (+110/-0)
postinst/migration-scripts/02_migrate_to_gsettings.py (+69/-0)
To merge this branch: bzr merge lp:~sil2100/compiz/gsettings_migration
Reviewer Review Type Date Requested Status
Daniel van Vugt 2012-07-23 Approve on 2012-07-24
Review via email: mp+116230@code.launchpad.net

Commit Message

Added .convert files (for gsettings-data-convert) and a migration python script (best for usage with session-migrations) for migrating some compiz settings from gconf to gsettings.

Description of the Change

Adding gsettings .convert files that could be used by gsettings-data-convert to migrate settings from gconf to gsettings. We also add a python script that makes this easier (actually used by session-migrate in our packaging). This is necessary for the gsettings compiz to work properly with existing gconf settings.

UNBLOCK

To post a comment you must log in.
Didier Roche (didrocks) wrote :

Hey Lukasz, it seems you forgot the case I discussed on Friday with you:

+ elif current_profile_str == 'Default':
308 + print "Will migrate 'Default' as the active profile"
309 + migrate_file('compiz-profile-active-Default.convert')
310 + migrate_file('compiz-profile-unity.convert')

you should take into account the case where compiz is installed without unity. So something alone the long:
else (instead of elif)
   migrate_file('compiz-profile-active-Default.convert')
   if compiz-profile-unity.convert is installed:
         migrate_file('compiz-profile-unity.convert')

Łukasz Zemczak (sil2100) wrote :

As already mentioned on IRC, the check for this case has been added but at the very beginning of the script - not to call gconf functions needlessly. But I am switching this to the approach mentioned by Didier.

3289. By Łukasz Zemczak on 2012-07-23

Introducing the changes as noted by Didier

Daniel van Vugt (vanvugt) wrote :

Doesn't seem to interfere with building/installing at all. So approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'postinst/convert-files'
2=== added file 'postinst/convert-files/compiz-profile-Default.convert'
3--- postinst/convert-files/compiz-profile-Default.convert 1970-01-01 00:00:00 +0000
4+++ postinst/convert-files/compiz-profile-Default.convert 2012-07-23 11:00:27 +0000
5@@ -0,0 +1,110 @@
6+[org.compiz.core:/org/compiz/profiles/Default/plugins/core/]
7+active-plugins = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/active_plugins
8+vsize = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/vsize
9+hsize = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/vsize
10+close_window_button = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/close_window_button
11+close-window-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/close_window_key
12+lower-window-button = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/lower_window_button
13+lower-window-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/lower_window_key
14+maximize-window-horizontally-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/maximize_window_horizontally_key
15+maximize-window-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/maximize_window_key
16+maximize-window-vertically-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/maximize_window_vertically_key
17+minimize-window-button = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/minimize_window_button
18+minimize-window-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/minimize_window_key
19+raise-window-button = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/raise_window_button
20+raise-window-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/raise_window_key
21+show-desktop-edge = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/show_desktop_edge
22+show-desktop-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/show_desktop_key
23+toggle-window_maximized-button = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/toggle_window_maximized_button
24+toggle-window-maximized-horizontally-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/toggle_window_maximized_horizontally_key
25+toggle-window-maximized-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/toggle_window_maximized_key
26+toggle-window-maximized-vertically-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/toggle_window_maximized_vertically_key
27+toggle-window-shaded-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/toggle_window_shaded_key
28+unmaximize-window-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/unmaximize_window_key
29+window-menu-button = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/window_menu_button
30+window-menu-key = /apps/compizconfig-1/profiles/Default/plugins/core/screen0/options/window_menu_key
31+
32+
33+[org.compiz.composite:/org/compiz/profiles/Default/plugins/composite/]
34+detect-refresh-rate = /apps/compizconfig-1/profiles/Default/plugins/composite/screen0/options/detect_refres_rate
35+refresh-rate = /apps/compizconfig-1/profiles/Default/plugins/composite/screen0/options/refres_rate
36+
37+
38+[org.compiz.opengl:/org/compiz/profiles/Default/plugins/opengl/]
39+lighting = /apps/compizconfig-1/profiles/Default/plugins/opengl/screen0/options/lighting
40+sync-to-vblank = /apps/compizconfig-1/profiles/Default/plugins/opengl/screen0/options/sync_to_vblank
41+texture-compression = /apps/compizconfig-1/profiles/Default/plugins/opengl/screen0/options/texture_compression
42+texture-filter = /apps/compizconfig-1/profiles/Default/plugins/opengl/screen0/options/texture_filter
43+
44+
45+[org.compiz.wall:/org/compiz/profiles/Default/plugins/wall/]
46+down-button = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/down_button
47+down-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/down_button
48+down-window-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/down_button
49+edgeflip-dnd = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/edgeflip_dnd
50+edgeflip-move = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/edgeflip_move
51+edgeflip-pointer = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/edgeflip_pointer
52+edge-radius = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/edge_radius
53+flip-down-edge = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/flip_down_edge
54+flip-left-edge = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/flip_left_edge
55+flip-right-edge = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/flip_right_edge
56+flip-up-edge = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/flip_up_edge
57+left-button = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/left_button
58+left-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/left_key
59+left-window-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/left_window_key
60+next-button = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/next_button
61+next-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/next_key
62+prev-button = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/prev_button
63+prev-key =/apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/prev_key
64+right-button = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/right_button
65+right-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/right_key
66+right-window-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/right_window_key
67+up-button = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/up_button
68+up-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/up_key
69+up-window-key = /apps/compizconfig-1/profiles/Default/plugins/wall/screen0/options/up_window_key
70+
71+
72+[org.compiz.expo:/org/compiz/profiles/Default/plugins/expo/]
73+exit-button = /apps/compizconfig-1/profiles/Default/plugins/expo/screen0/options/exit_button
74+expo-edge = /apps/compizconfig-1/profiles/Default/plugins/expo/screen0/options/expo_edge
75+expo-key = /apps/compizconfig-1/profiles/Default/plugins/expo/screen0/options/expo_key
76+expo-immediate-move = /apps/compizconfig-1/profiles/Default/plugins/expo/screen0/options/expo_immediate_move
77+next-vp-button = /apps/compizconfig-1/profiles/Default/plugins/expo/screen0/options/next_vp_button
78+prev-vp-button = /apps/compizconfig-1/profiles/Default/plugins/expo/screen0/options/prev_vp_button
79+
80+
81+[org.compiz.move:/org/compiz/profiles/Default/plugins/move/]
82+initiate-button = /apps/compizconfig-1/profiles/Default/plugins/move/screen0/options/initiate_button
83+initiate-key = /apps/compizconfig-1/profiles/Default/plugins/move/screen0/options/initiate_key
84+
85+
86+[org.compiz.grid:/org/compiz/profiles/Default/plugins/grid/]
87+bottom-edge-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/bottom_edge_action
88+bottom-edge-threshold = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/bottom_edge_threshold
89+bottom-left-corner-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/bottom_left_corner_action
90+bottom-right-corner-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/bottom_right_corner_action
91+draw-indicator = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/draw_indicator
92+fill-color = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/fill_color
93+left-edge-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/left_edge_action
94+left-edge-threshold = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/left_edge_threshold
95+outline-color = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/outline_color
96+put-bottom-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_bottom_key
97+put-bottomleft-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_bottomleft_key
98+put-bottomright-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_bottomright_key
99+put-center-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_center_key
100+put-left-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_left_key
101+put-maximize-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_maximize_key
102+put-restore-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_restore_key
103+put-right-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_right_key
104+put-top-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_top_key
105+put-topleft-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_topleft_key
106+put-topright-key = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/put_topright_key
107+right-edge-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/right_edge_action
108+right-edge-threshold = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/right_edge_threshold
109+snapback-windows = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/snapback_windows
110+snapoff-maximized = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/snapoff_maximized
111+top-edge_action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/top_edge_action
112+top-edge_threshold = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/top_edge_threshold
113+top-left-corner-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/top_left_corner_action
114+top-right-corner-action = /apps/compizconfig-1/profiles/Default/plugins/grid/screen0/options/top_right_corner_action
115+
116
117=== added file 'postinst/convert-files/compiz-profile-active-Default.convert'
118--- postinst/convert-files/compiz-profile-active-Default.convert 1970-01-01 00:00:00 +0000
119+++ postinst/convert-files/compiz-profile-active-Default.convert 2012-07-23 11:00:27 +0000
120@@ -0,0 +1,110 @@
121+[org.compiz.core:/org/compiz/profiles/Default/plugins/core/]
122+active-plugins = /apps/compiz-1/plugins/core/screen0/options/active_plugins
123+vsize = /apps/compiz-1/plugins/core/screen0/options/vsize
124+hsize = /apps/compiz-1/plugins/core/screen0/options/vsize
125+close_window_button = /apps/compiz-1/plugins/core/screen0/options/close_window_button
126+close-window-key = /apps/compiz-1/plugins/core/screen0/options/close_window_key
127+lower-window-button = /apps/compiz-1/plugins/core/screen0/options/lower_window_button
128+lower-window-key = /apps/compiz-1/plugins/core/screen0/options/lower_window_key
129+maximize-window-horizontally-key = /apps/compiz-1/plugins/core/screen0/options/maximize_window_horizontally_key
130+maximize-window-key = /apps/compiz-1/plugins/core/screen0/options/maximize_window_key
131+maximize-window-vertically-key = /apps/compiz-1/plugins/core/screen0/options/maximize_window_vertically_key
132+minimize-window-button = /apps/compiz-1/plugins/core/screen0/options/minimize_window_button
133+minimize-window-key = /apps/compiz-1/plugins/core/screen0/options/minimize_window_key
134+raise-window-button = /apps/compiz-1/plugins/core/screen0/options/raise_window_button
135+raise-window-key = /apps/compiz-1/plugins/core/screen0/options/raise_window_key
136+show-desktop-edge = /apps/compiz-1/plugins/core/screen0/options/show_desktop_edge
137+show-desktop-key = /apps/compiz-1/plugins/core/screen0/options/show_desktop_key
138+toggle-window_maximized-button = /apps/compiz-1/plugins/core/screen0/options/toggle_window_maximized_button
139+toggle-window-maximized-horizontally-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_maximized_horizontally_key
140+toggle-window-maximized-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_maximized_key
141+toggle-window-maximized-vertically-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_maximized_vertically_key
142+toggle-window-shaded-key = /apps/compiz-1/plugins/core/screen0/options/toggle_window_shaded_key
143+unmaximize-window-key = /apps/compiz-1/plugins/core/screen0/options/unmaximize_window_key
144+window-menu-button = /apps/compiz-1/plugins/core/screen0/options/window_menu_button
145+window-menu-key = /apps/compiz-1/plugins/core/screen0/options/window_menu_key
146+
147+
148+[org.compiz.composite:/org/compiz/profiles/Default/plugins/composite/]
149+detect-refresh-rate = /apps/compiz-1/plugins/composite/screen0/options/detect_refres_rate
150+refresh-rate = /apps/compiz-1/plugins/composite/screen0/options/refres_rate
151+
152+
153+[org.compiz.opengl:/org/compiz/profiles/Default/plugins/opengl/]
154+lighting = /apps/compiz-1/plugins/opengl/screen0/options/lighting
155+sync-to-vblank = /apps/compiz-1/plugins/opengl/screen0/options/sync_to_vblank
156+texture-compression = /apps/compiz-1/plugins/opengl/screen0/options/texture_compression
157+texture-filter = /apps/compiz-1/plugins/opengl/screen0/options/texture_filter
158+
159+
160+[org.compiz.wall:/org/compiz/profiles/Default/plugins/wall/]
161+down-button = /apps/compiz-1/plugins/wall/screen0/options/down_button
162+down-key = /apps/compiz-1/plugins/wall/screen0/options/down_button
163+down-window-key = /apps/compiz-1/plugins/wall/screen0/options/down_button
164+edgeflip-dnd = /apps/compiz-1/plugins/wall/screen0/options/edgeflip_dnd
165+edgeflip-move = /apps/compiz-1/plugins/wall/screen0/options/edgeflip_move
166+edgeflip-pointer = /apps/compiz-1/plugins/wall/screen0/options/edgeflip_pointer
167+edge-radius = /apps/compiz-1/plugins/wall/screen0/options/edge_radius
168+flip-down-edge = /apps/compiz-1/plugins/wall/screen0/options/flip_down_edge
169+flip-left-edge = /apps/compiz-1/plugins/wall/screen0/options/flip_left_edge
170+flip-right-edge = /apps/compiz-1/plugins/wall/screen0/options/flip_right_edge
171+flip-up-edge = /apps/compiz-1/plugins/wall/screen0/options/flip_up_edge
172+left-button = /apps/compiz-1/plugins/wall/screen0/options/left_button
173+left-key = /apps/compiz-1/plugins/wall/screen0/options/left_key
174+left-window-key = /apps/compiz-1/plugins/wall/screen0/options/left_window_key
175+next-button = /apps/compiz-1/plugins/wall/screen0/options/next_button
176+next-key = /apps/compiz-1/plugins/wall/screen0/options/next_key
177+prev-button = /apps/compiz-1/plugins/wall/screen0/options/prev_button
178+prev-key =/apps/compiz-1/plugins/wall/screen0/options/prev_key
179+right-button = /apps/compiz-1/plugins/wall/screen0/options/right_button
180+right-key = /apps/compiz-1/plugins/wall/screen0/options/right_key
181+right-window-key = /apps/compiz-1/plugins/wall/screen0/options/right_window_key
182+up-button = /apps/compiz-1/plugins/wall/screen0/options/up_button
183+up-key = /apps/compiz-1/plugins/wall/screen0/options/up_key
184+up-window-key = /apps/compiz-1/plugins/wall/screen0/options/up_window_key
185+
186+
187+[org.compiz.expo:/org/compiz/profiles/Default/plugins/expo/]
188+exit-button = /apps/compiz-1/plugins/expo/screen0/options/exit_button
189+expo-edge = /apps/compiz-1/plugins/expo/screen0/options/expo_edge
190+expo-key = /apps/compiz-1/plugins/expo/screen0/options/expo_key
191+expo-immediate-move = /apps/compiz-1/plugins/expo/screen0/options/expo_immediate_move
192+next-vp-button = /apps/compiz-1/plugins/expo/screen0/options/next_vp_button
193+prev-vp-button = /apps/compiz-1/plugins/expo/screen0/options/prev_vp_button
194+
195+
196+[org.compiz.move:/org/compiz/profiles/Default/plugins/move/]
197+initiate-button = /apps/compiz-1/plugins/move/screen0/options/initiate_button
198+initiate-key = /apps/compiz-1/plugins/move/screen0/options/initiate_key
199+
200+
201+[org.compiz.grid:/org/compiz/profiles/Default/plugins/grid/]
202+bottom-edge-action = /apps/compiz-1/plugins/grid/screen0/options/bottom_edge_action
203+bottom-edge-threshold = /apps/compiz-1/plugins/grid/screen0/options/bottom_edge_threshold
204+bottom-left-corner-action = /apps/compiz-1/plugins/grid/screen0/options/bottom_left_corner_action
205+bottom-right-corner-action = /apps/compiz-1/plugins/grid/screen0/options/bottom_right_corner_action
206+draw-indicator = /apps/compiz-1/plugins/grid/screen0/options/draw_indicator
207+fill-color = /apps/compiz-1/plugins/grid/screen0/options/fill_color
208+left-edge-action = /apps/compiz-1/plugins/grid/screen0/options/left_edge_action
209+left-edge-threshold = /apps/compiz-1/plugins/grid/screen0/options/left_edge_threshold
210+outline-color = /apps/compiz-1/plugins/grid/screen0/options/outline_color
211+put-bottom-key = /apps/compiz-1/plugins/grid/screen0/options/put_bottom_key
212+put-bottomleft-key = /apps/compiz-1/plugins/grid/screen0/options/put_bottomleft_key
213+put-bottomright-key = /apps/compiz-1/plugins/grid/screen0/options/put_bottomright_key
214+put-center-key = /apps/compiz-1/plugins/grid/screen0/options/put_center_key
215+put-left-key = /apps/compiz-1/plugins/grid/screen0/options/put_left_key
216+put-maximize-key = /apps/compiz-1/plugins/grid/screen0/options/put_maximize_key
217+put-restore-key = /apps/compiz-1/plugins/grid/screen0/options/put_restore_key
218+put-right-key = /apps/compiz-1/plugins/grid/screen0/options/put_right_key
219+put-top-key = /apps/compiz-1/plugins/grid/screen0/options/put_top_key
220+put-topleft-key = /apps/compiz-1/plugins/grid/screen0/options/put_topleft_key
221+put-topright-key = /apps/compiz-1/plugins/grid/screen0/options/put_topright_key
222+right-edge-action = /apps/compiz-1/plugins/grid/screen0/options/right_edge_action
223+right-edge-threshold = /apps/compiz-1/plugins/grid/screen0/options/right_edge_threshold
224+snapback-windows = /apps/compiz-1/plugins/grid/screen0/options/snapback_windows
225+snapoff-maximized = /apps/compiz-1/plugins/grid/screen0/options/snapoff_maximized
226+top-edge_action = /apps/compiz-1/plugins/grid/screen0/options/top_edge_action
227+top-edge_threshold = /apps/compiz-1/plugins/grid/screen0/options/top_edge_threshold
228+top-left-corner-action = /apps/compiz-1/plugins/grid/screen0/options/top_left_corner_action
229+top-right-corner-action = /apps/compiz-1/plugins/grid/screen0/options/top_right_corner_action
230+
231
232=== added directory 'postinst/migration-scripts'
233=== added file 'postinst/migration-scripts/02_migrate_to_gsettings.py'
234--- postinst/migration-scripts/02_migrate_to_gsettings.py 1970-01-01 00:00:00 +0000
235+++ postinst/migration-scripts/02_migrate_to_gsettings.py 2012-07-23 11:00:27 +0000
236@@ -0,0 +1,69 @@
237+#!/usr/bin/python
238+# -*- coding: utf-8 -*-
239+# Copyright (C) 2012 Canonical
240+#
241+# Authors:
242+# Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>
243+# Didier Roche <didrocks@ubuntu.com>
244+#
245+# This program is free software; you can redistribute it and/or modify it under
246+# the terms of the GNU General Public License as published by the Free Software
247+# Foundation; version 3.
248+#
249+# This program is distributed in the hope that it will be useful, but WITHOUTa
250+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
251+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
252+# details.
253+#
254+# You should have received a copy of the GNU General Public License along with
255+# this program; if not, write to the Free Software Foundation, Inc.,
256+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
257+
258+import gconf
259+import glib
260+import subprocess
261+import os.path
262+
263+# this should point to the directory where all the .convert files are stored
264+CONVERT_PATH = "/usr/lib/compiz/migration/"
265+
266+def migrate_file(convert_file):
267+ subprocess.Popen(["gsettings-data-convert", "--file={}{}".format(CONVERT_PATH, convert_file)]).communicate()
268+
269+def migrate_gconf_to_gsettings():
270+ client = gconf.client_get_default()
271+
272+ if not client:
273+ print "WARNING: no gconf client found. No transitionning will be done"
274+ return
275+
276+ # get current compiz profile to know if we need to switch or not
277+ # as compiz is setting that as a default key schema each time you
278+ # change the profile, the key isn't straightforward to get and set
279+ # as compiz set a new schema instead of a value..
280+ try:
281+ current_profile_schema = client.get_schema("/apps/compizconfig-1/current_profile")
282+ except (glib.GError, AttributeError):
283+ print "No current profile set, no migration needed"
284+ return
285+
286+ if current_profile_schema:
287+ current_profile_gconfvalue = current_profile_schema.get_default_value()
288+ current_profile_str = current_profile_gconfvalue.get_string()
289+ else:
290+ print "No current profile set, no migration needed"
291+ return
292+
293+ # depending what current profile is set, migrate using specific .convert files
294+ if current_profile_str == 'unity':
295+ print "Will migrate 'unity' as the active profile"
296+ migrate_file('compiz-profile-active-unity.convert')
297+ migrate_file('compiz-profile-Default.convert')
298+ else:
299+ print "Will migrate 'Default' as the active profile"
300+ migrate_file('compiz-profile-active-Default.convert')
301+ if os.path.exists(CONVERT_PATH + 'compiz-profile-unity.convert'):
302+ migrate_file('compiz-profile-unity.convert')
303+
304+if __name__ == '__main__':
305+ migrate_gconf_to_gsettings ()

Subscribers

People subscribed via source and target branches