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
|
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
|
-
+
-
-
+
+
+
+
+
+
|
# uncheck this plugin. The standard rendering will take hold after
# a restart.
# Other themes can be used with the `gtk_theme` plugin easily.
#
# (!) Only works with `librezlooks.dll` in place however.
import os
import os, shutil
from config import *
from uikit import gtk
from compat2and3 import *
# register a key
class win_theme_rezlooks(object):
# plugin info
module = "win_theme_rezlooks"
meta = plugin_meta()
gtk_dll = 'C:\\Python27\\Lib\\site-packages\\gtk-2.0\\runtime\\lib\\gtk-2.0\\2.10.0\\engines\\librezlooks.dll'
gtk_dll_src = '%s/dev/librezlooks.dll' % conf.share
# use builtin .GTKRC
def __init__(self, parent):
# assert gtk-engine is there, else copy it over
if not os.path.exists(self.gtk_dll):
if os.path.exists(self.gtk_dll_src)
os.copy(self.gtk_dll_src, self.gtk_dll)
if os.path.exists(self.gtk_dll_src):
try:
shutil.copyfile(self.gtk_dll_src, self.gtk_dll)
except:
log.ERR("could not copy librezlooks.dll")
return
else:
return
# apply theme
gtk.rc_parse_string(self.gtkrc)
gtk.rc_reparse_all()
# probably redundant:
gtk.rc_reset_styles(gtk.settings_get_for_screen(gtk.gdk.screen_get_default()))
|