-
Notifications
You must be signed in to change notification settings - Fork 3
/
DefaultGConfValues.py
59 lines (53 loc) · 2.26 KB
/
DefaultGConfValues.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- coding: utf-8 -*-
#
# This file is part of the Rhythmbox Desktop Art plug-in
#
# Copyright © 2008 Mathias Nedrebø < mathias at nedrebo dot org >
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from gi.repository import Gtk, GConf, Gdk
GConf_plugin_path = '/apps/rhythmbox/plugins/desktop-art/'
defaults = {'roundness' : 0.3,
'background_color' : '#0000000000004ccc',
'text_color' : '#ffffffffffffb332',
'text_shadow_color' : '#000000000000b332',
'draw_reflection' : True,
'window_x' : 50,
'window_y' : Gdk.Screen.height() - 190 - 40,
'window_w' : Gdk.Screen.width() - 100,
'window_h' : 190,
'text_position' : 'se',
'blur' : 1,
'reflection_height' : 0.4,
'reflection_intensity' : 0.4,
'hover_size' : 0.7,
'border' : 0.06,
'text_font' : 'Normal'}
def GConf_path(key):
return '%s%s' % (GConf_plugin_path, key)
gc = GConf.Client.get_default()
for key, val in list(defaults.items()):
path = GConf_path(key)
if gc.get_without_default(path) == None:
if isinstance(val, bool):
gc.set_bool(path, val)
elif isinstance(val, int):
gc.set_int(path, val)
elif isinstance(val, float):
gc.set_float(path, val)
elif isinstance(val, str):
gc.set_string(path, val)
else:
print('Datatype %s is not supported' % type(val))