Skip to content

Commit 43ea94d

Browse files
committed
Add icon for cinnamon desktop - closes #98
1 parent e1f0a90 commit 43ea94d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

indicator-sysmonitor

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,16 @@ CPU {{cpu}} | MEM {{mem}} | root {{fs///}}
6868
fs_desc=_("Show available space in the file system."),
6969
example=_("Example:"))
7070

71+
indicator_icon = '<?xml version="1.0" encoding="UTF-8"?> \
72+
<svg width="800px" height="800px" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg"> \
73+
<defs><style>.a{fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;}</style></defs> \
74+
<path class="a" d="m40.5 5.5h-33a2 2 0 0 0-2 2v33a2 2 0 0 0 2 2h33a2 2 0 0 0 2-2v-33a2 2 0 0 0-2-2z" stroke="#fff"/> \
75+
<polyline class="a" points="9.5 23.717 17.98 23.717 19.393 25.922 20.919 22.7 23.463 37.624 25.385 10.376 27.307 24.509 28.551 23.717 38.5 23.717" stroke="#fff"/></svg>'
7176

77+
empty_icon = '<?xml version="1.0" encoding="UTF-8" \
78+
standalone="no"?><svg id="empty" xmlns="http://www.w3.org/2000/svg" \
79+
height="22" width="1" version="1.0" \
80+
xmlns:xlink="http://www.w3.org/1999/xlink"></svg>'
7281
class IndicatorSysmonitor(object):
7382
SENSORS_DISABLED = False
7483

@@ -77,12 +86,13 @@ class IndicatorSysmonitor(object):
7786
self._help_dialog = None
7887

7988
fn, self.tindicator = tempfile.mkstemp(suffix=".svg")
89+
svg = empty_icon
90+
desktop_environment = os.environ.get('DESKTOP_SESSION')
91+
if desktop_environment:
92+
if desktop_environment.lower()[:8] == 'cinnamon':
93+
svg = indicator_icon
8094

8195
with open(self.tindicator, "w") as f:
82-
svg = '<?xml version="1.0" encoding="UTF-8" \
83-
standalone="no"?><svg id="empty" xmlns="http://www.w3.org/2000/svg" \
84-
height="22" width="1" version="1.0" \
85-
xmlns:xlink="http://www.w3.org/1999/xlink"></svg>'
8696
f.write(svg)
8797
f.close()
8898

0 commit comments

Comments
 (0)