diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-03-24 17:30:24 +0100 | 
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2014-03-24 17:30:24 +0100 | 
| commit | 38eb28c7119b9c32d2ab6b54fe36a37ab22a2e9e (patch) | |
| tree | 88d0055adf28120f5751870d91caf911a8224270 | |
| parent | 96aa0a3261325de5d83ae95dd7a71ca26922c958 (diff) | |
02_unity_setup_text_scale_factor: actually make it working, copy the gnome value to unity
(bzr r3725.7.32)
| -rwxr-xr-x | tools/migration-scripts/02_unity_setup_text_scale_factor | 14 | 
1 files changed, 8 insertions, 6 deletions
| diff --git a/tools/migration-scripts/02_unity_setup_text_scale_factor b/tools/migration-scripts/02_unity_setup_text_scale_factor index 918ebd6a0..72a0c9f7c 100755 --- a/tools/migration-scripts/02_unity_setup_text_scale_factor +++ b/tools/migration-scripts/02_unity_setup_text_scale_factor @@ -22,18 +22,20 @@ from gi.repository import Gio  import os,sys  GNOME_UI_SETTINGS = "org.gnome.desktop.interface"; -GNOME_UI_SETTINGS_PATH = "/org/gnome/desktop/interface/"  GNOME_TEXT_SCALE_FACTOR = "text-scaling-factor"; +UNITY_UI_SETTINGS = "com.canonical.Unity.Interface"; +UNITY_UI_SETTINGS_PATH = "/com/canonical/unity/interface/" +UNITY_TEXT_SCALE_FACTOR = "text-scale-factor"; +  if GNOME_UI_SETTINGS not in Gio.Settings.list_schemas():  print("No gnome desktop interface schemas found, no migration needed")  sys.exit(0) -ui_settings = Gio.Settings(schema=GNOME_UI_SETTINGS, path=GNOME_UI_SETTINGS_PATH) -text_scale_factor = ui_settings.get_double(GNOME_TEXT_SCALE_FACTOR) +text_scale_factor = Gio.Settings(schema=GNOME_UI_SETTINGS).get_double(GNOME_TEXT_SCALE_FACTOR)  # gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf! -# ui_settings.set_int(GNOME_TEXT_SCALE_FACTOR, text_scale_factor) +# Gio.Settings(schema=UNITY_UI_SETTINGS).set_int(UNITY_TEXT_SCALE_FACTOR, text_scale_factor)  from subprocess import Popen, PIPE, STDOUT -p = Popen(("dconf load "+GNOME_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT) -p.communicate(input="[/]\n"+GNOME_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor).encode('utf-8')) +p = Popen(("dconf load "+UNITY_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT) +p.communicate(input="[/]\n"+UNITY_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor).encode('utf-8')) | 
