Desktop files for apps installed in toolbox

After some minor tweaking i got audio and 3d-aceleration working inside toolbox. So i tried copying the desktop file of an app(installed inside toolbox) to ~/.local/share/applications and edited the Exec line:

Exec=toolbox run /usr/bin/chromium-browser %U

After this the app runs and works perfectly, except one minor thing. If i pin the app and then open it, two icons appear in the dash. Other apps also showed same results.
Are the WMClass of container apps somehow different than non-container ones?
(Although xprop gave the same WMClass “Chromium-browser”)

Edit: As i was writing this, i tested another app called Minetest. It does actually works but it breaks, after launching if i open overview (swooshing mouse to the top-left screen) just before the minetest window appears then two icons problem happens again. This wasn’t reproducible with chromium.
Screenshot%20from%202019-10-18%2023-25-52

Did you (or anyone) ever find I fix for this? I have the same issue with Emacs.

I would prefer if my Emacs running in Toolbox to share the icon in the switcher with the instance on my desktop, apart from liking it if the icon for the Toolbox instance not beeing so ugly (that’s the fuzzy one).

However, most annoying is that running the same .desktop file multiple times will start new instances of the program, rather than focusing Emacs, which is what I’d expect.

Here’s the .desktop for the one running from Toolbox:

[Desktop Entry]
Name=Emacs (astro)
Type=Application
Exec=toolbox run --container astro emacsclient --alternate-editor '' --socket 'ledger' --create-frame
Icon=emacs
Categories=Utility;TextEditor;
Keywords=toolbox;
StartupWMClass=Emacs

I would think that would be problematic since the desktop icon is a launch action. Just thinking about it off the top of my head.

That’s true, I guess would in fact want it to associate with only the windows from the Toolbox, and be able to have a different icon, which I guess would require them to have a different class.

[Update: though to be fair, just keeping the extra launchers as launchers but let the windows “dock” with the main Emacs icon would also work for me.]

[Desktop Entry]
Name=Emacs (ledger)
Type=Application
Exec=toolbox run --container ledger emacsclient --alternate-editor '' --socket 'ledger' --create-frame --frame-parameters '((name . "emacs-ledger"))'
Icon=emacs-toolbox
Categories=Utility;TextEditor;
Keywords=toolbox;
StartupWMClass=emacs-ledger

Tried this with one of my other toolboxes. This makes the frame get created with the wmclass “emacs-ledger”, the new window still doesn’t get linked to the icon, so it doesn’t use the icon I assigned to it, and opens additional frames if I run it again.

Raised this as an issue with Toolbox to see if someone there might be able to give some clarity: https://github.com/containers/toolbox/issues/586

1 Like