Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions/cpsection/aboutme/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/cpsection/aboutme/model.py')
-rw-r--r--extensions/cpsection/aboutme/model.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/extensions/cpsection/aboutme/model.py b/extensions/cpsection/aboutme/model.py
index ad1de66..7395ae9 100644
--- a/extensions/cpsection/aboutme/model.py
+++ b/extensions/cpsection/aboutme/model.py
@@ -17,6 +17,8 @@
from gettext import gettext as _
from gi.repository import GConf
+import shutil
+import os
_COLORS = {
@@ -123,3 +125,19 @@ def set_color_xo(color):
client = GConf.Client.get_default()
client.set_string('/desktop/sugar/user/color', color)
return 1
+
+
+def set_xo_icon(path, icon_name):
+ """ Replace computer-xo.svg icon """
+ pt = os.path.join(os.path.expanduser('~'), '.current')
+ fd = open(pt, 'w')
+ fd.write(icon_name)
+ fd.close()
+ if os.path.exists('/usr/share/icons/sugar/scalable/device/'):
+ iconpath = '/usr/share/icons/sugar/scalable/device/computer-xo.svg'
+ shutil.copy(path, iconpath)
+ if os.path.exists('/opt/sweets/sugar-artwork/share/icons/sugar/scalable/device'):
+ iconpath = '/opt/sweets/sugar-artwork/share/icons/sugar/scalable/device/computer-xo.svg'
+ shutil.copy(path, iconpath)
+ else:
+ pass