2
# -*- coding: utf-8 -*-
3
# Copyright (C) 2012 Canonical
6
# Didier Roche <didrocks@ubuntu.com>
8
# This program is free software; you can redistribute it and/or modify it under
9
# the terms of the GNU General Public License as published by the Free Software
10
# Foundation; version 3.
12
# This program is distributed in the hope that it will be useful, but WITHOUTa
13
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
# You should have received a copy of the GNU General Public License along with
18
# this program; if not, write to the Free Software Foundation, Inc.,
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
from gi.repository import Gio
24
gsettings=Gio.Settings(schema="org.compiz.core", path="/org/compiz/profiles/Default/plugins/core/")
25
plugins_list = gsettings.get_strv("active-plugins")
27
# Remove unityshell the default profile if present (case of new install and first session startup)
29
plugins_list.remove('unityshell')
33
plugins_list.remove('unitymtgrabhandles')
36
# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
37
#gsettings.set_strv("active-plugins", plugins_list)
38
from subprocess import Popen, PIPE, STDOUT
39
p = Popen(['dconf', 'load', '/org/compiz/profiles/Default/plugins/core/'], stdout=PIPE, stdin=PIPE, stderr=STDOUT)
40
p.communicate(input="[/]\nactive-plugins=%s" % plugins_list)
42
# remove the eventually existing local config file which can prevent the default profile to use gsettings for quantal users before this fix
44
os.remove(os.path.join(os.path.expanduser('~'), '.config', 'compiz-1', 'compizconfig', 'config'))