diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2017-10-02 15:02:08 -0400 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2017-10-02 15:02:08 -0400 |
| commit | ba9193ea942e2c41855abacc11f6e4d6fbc2766f (patch) | |
| tree | cfb13b2d71ac37d8eee59c664e98649f52f577a2 | |
| parent | 9d83ef73448c092d425b2e622ec2f3be079cbe7d (diff) | |
02_unity_setup_text_scale_factor: don't use dconf anymore
(bzr r4253.4.4)
| -rwxr-xr-x | tools/migration-scripts/02_unity_setup_text_scale_factor | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/tools/migration-scripts/02_unity_setup_text_scale_factor b/tools/migration-scripts/02_unity_setup_text_scale_factor index b4d42557d..5f8201eab 100755 --- a/tools/migration-scripts/02_unity_setup_text_scale_factor +++ b/tools/migration-scripts/02_unity_setup_text_scale_factor @@ -1,6 +1,6 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -# Copyright (C) 2014-2015 Canonical +# Copyright (C) 2014-2017 Canonical # # Authors: # Marco Trevisan <marco.trevisan@canonical.com> @@ -25,7 +25,6 @@ GNOME_UI_SETTINGS = "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"; gnome_ui_schema = Gio.SettingsSchemaSource.get_default().lookup(GNOME_UI_SETTINGS, recursive=False) @@ -35,8 +34,5 @@ if not gnome_ui_schema: text_scale_factor = Gio.Settings(settings_schema=gnome_ui_schema).get_double(GNOME_TEXT_SCALE_FACTOR) -# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf! -# 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 "+UNITY_UI_SETTINGS_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT) -p.communicate(input=bytes("[/]\n"+UNITY_TEXT_SCALE_FACTOR+"={}".format(text_scale_factor), 'utf-8')) +Gio.Settings.new(UNITY_UI_SETTINGS).set_double(UNITY_TEXT_SCALE_FACTOR, text_scale_factor) +Gio.Settings.sync() |
