Snaps currently supports themed icons, but, there is a big problem. You’ll need to put the icons with the name snap.<snap_name>.<icon_name> in the meta/gui
folder. Now, it’s very tough/tedious process to manually do this in the snap manifest. But, even if someone does this, if a metadata file is given to parse, snapcraft will parse it and instead of putting the icon themes to the proper folder, it’ll automatically select an icon (mostly sclable ones) and hardcode the path of it in the desktop file. Now, to get rid of this, one need to edit these
diff -Naur a/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.desktop.in b/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.desktop.in
--- a/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.desktop.in 2023-06-13 00:34:09.996218531 +0530
+++ b/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.desktop.in 2023-06-13 00:42:47.352870719 +0530
@@ -3,7 +3,7 @@
Name=Tube Converter
Comment=Get video and audio from the web
Exec=@EXEC@
-Icon=org.nickvision.tubeconverter
+Icon=snap.tube-converter.org.nickvision.tubeconverter
Terminal=false
Type=Application
Categories=AudioVideo;Network;
diff -Naur a/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.metainfo.xml.in b/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.metainfo.xml.in
--- a/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.metainfo.xml.in 2023-06-11 21:08:29.643511112 +0530
+++ b/NickvisionTubeConverter.Shared/Linux/org.nickvision.tubeconverter.metainfo.xml.in 2023-06-13 00:39:01.039920329 +0530
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.nickvision.tubeconverter</id>
+ <icon type="stock">snap.tube-converter.org.nickvision.tubeconverter</icon>
<metadata_license>CC0-1.0</metadata_license>
<project_license>MIT</project_license>
<name>Tube Converter</name>
This is an example patch file. Now, even after all of this, what you’ll get is a cog icon on the first time installation of those apps specifically in gnome. Because, for gnome to use icon theme, one needs to update the index.theme
file which contains the folder structure of the directory(/var/lib/snapd/desktop/icons
for snaps) which contains the icon themes. Updating the index.theme
or doing anything in this directory is absolutely impossible from within a snap. So, we have two options, either don’t have symbolic icons/themed icons or scarfice for the first time an user installs the app.
One possible way is to allow the extensions do the job, specifically gnome extension. To update or add the index.theme
file during installation, and allow those binaries from gnome extension modify those folders. Another is to let snapd itself handle these.