Skip to content

Commit 30a8144

Browse files
authored
cs-info: Add system icon (#11090)
* cs-info: Add system icon A vendor can disable this. It simply adds a Gtk Image under the system info data which can be configured by a gschema.
1 parent 24d660a commit 30a8144

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

data/org.cinnamon.gschema.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,18 @@
501501
<summary>If true, Cinnamon will no longer attempt to be the session notification handler.</summary>
502502
</key>
503503

504-
<child name="theme" schema="org.cinnamon.theme"/>
504+
<key type="s" name="system-icon-path">
505+
<default>"/usr/share/icons/vendor/scalable/emblems/emblem-vendor.svg"</default>
506+
<summary>The logo to use in the system info settings</summary>
507+
<description>
508+
An icon name or absolute path to an icon, which will be used for the system icon in the "System Info" settings app.
509+
The default path is the emblem-vendor image stored in /usr/share/icons/vendor.
510+
.
511+
Disabled if no value is set.
512+
</description>
513+
</key>
514+
515+
<child name="theme" schema="org.cinnamon.theme"/>
505516
<child name="recorder" schema="org.cinnamon.recorder"/>
506517
<child name="keyboard" schema="org.cinnamon.keyboard"/>
507518
<child name="desklets" schema="org.cinnamon.desklets" />

files/usr/share/cinnamon/cinnamon-settings/modules/cs_info.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ def getProcInfos():
9393
return result
9494

9595

96+
def getSystemIcon():
97+
schema = Gio.Settings(schema="org.cinnamon")
98+
99+
iconPath = schema.get_string("system-icon-path")
100+
if iconPath is "": # left empty, so its disabled
101+
return None
102+
103+
return iconPath
104+
105+
96106
def createSystemInfos():
97107
procInfos = getProcInfos()
98108
infos = []
@@ -203,6 +213,12 @@ def on_module_selected(self):
203213
button.connect("clicked", self.on_copy_clipboard_button_clicked)
204214
widget.pack_start(button, True, True, 0)
205215
settings.add_row(widget)
216+
217+
systemIconPath = getSystemIcon()
218+
if systemIconPath is not None:
219+
systemIcon = Gtk.Image.new_from_file(systemIconPath)
220+
page.add(systemIcon)
221+
206222

207223
def on_copy_clipboard_button_clicked(self, button):
208224
try:

0 commit comments

Comments
 (0)