Missing gui application icon when app launched in toolbox

I’m on Fedora Linux Silverblue 41. I use toolbox to install emacs.
After running emacs in toolbox Gnome dock has no icon for it.
Is this default behaviour of running toolbox gui apps from terminal or am i missing something?

Summary
⬢ [fywrite@toolbx ~]$ ls /usr/share/applications/
emacs.desktop  emacs-mail.desktop  geoclue-demo-agent.desktop  mimeapps.list  xdg-desktop-portal-gtk.desktop
⬢ [fywrite@toolbx ~]$ less /usr/share/applications/emacs.desktop 

[Desktop Entry]
Name=Emacs
GenericName=Text Editor
Comment=Edit text
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=emacs-desktop %F
Icon=emacs
Type=Application
Terminal=false
Categories=Development;TextEditor;
StartupNotify=true
StartupWMClass=Emacs
/usr/share/applications/emacs.desktop (END)

⬢ [fywrite@toolbx ~]$ ls /usr/share/emacs/29.4/etc/ | grep emacs.icon
emacs.icon
Summary for installation process via toolbox
fywrite@fedora:~$ toolbox create dev
Created container: dev
Enter with: toolbox enter dev
fywrite@fedora:~$ toolbox enter dev
⬢ [fywrite@toolbx ~]$ dnf history list
ID Command line                                                                                                                                Date and time       Action(s) Altered
 1 dnf5 --config /builddir/result/image/build/image-root/kiwi_dnf5.conf -y --disable-plugin=priorities,versionlock --installroot /builddir/res 2024-11-18 06:48:27               354
⬢ [fywrite@toolbx ~]$ sudo dnf install emacs
⬢ [fywrite@toolbx ~]$ emacs

Problem solved.

This is normal when running apps with no .desktop entry

Read into it, you can create one your own, that launches the program through toolbx.

Inside the toolbx:

cp /usr/share/applications/emacs.desktop ~/.local/share/applications/
cp /usr/share/icons/somedirectory/emacs.svg ~/.local/share/icons/emacs.svg

If emacs has no desktop entry, you can create the entry manually. You can download an SVG icon from the internet if you dont find it.

cat > ~/.local/share/applications/emacs-toolbox.desktop <<EOF
[Desktop Entry]
Type=Application
Name=Emacs (Toolbox)
Exec=toolbox run -c BOXNAME emacs
Icon=$HOME/.local/share/icons/emacs.svg
Terminal=false
Categories=Development;Editor;
EOF

Or you can use distrobox and the distrobox-export --app feature, which makes this easy. Uses the same containers and technology, just a different manager.

Added atomic-desktops, f41, gnome, silverblue, toolbx