https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1732482 https://forum.snapcraft.io/t/how-to-expose-desktop-files-created-by-snaps-to-the-de/2853
Chromium has a feature that lets you add web apps to the desktop and app menu using
Options
-> More tools
-> Create shortcut...
. This is great because you can have
apps for e.g. Twitter or WhatsApp appearing to be standalone apps (because the browser
shell is hidden).
Sadly, at least with the Snap installation of Chromium, the generated .desktop files are broken (they have an invalid icon and open an empty Chromium window). But while the created shortcuts don't work, the apps are indeed added to the Chrome Apps (chrome://apps).
Using the script, all Chromium apps installed can be listed and proper shortcuts can be created
(which are added to the user's app launchers located under ~/.local/share/applications
).
To add a web app to the app drawer,
- Open the website
Options
->More tools
->Create shortcut...
, while making sure "Open as window" is ticked- Delete the shortcut created on your desktop
- Download the script and open a terminal in the directory you downloaded it to.
- Run
./chromium-snap-desktop-generator.sh
. It will output a list of all Chrome apps.
Instagram maonlnecdeecdljpahhnnlmhbmalehlm
The Air Horner mepckecgignpfokhpmhopohiikfbpnai
Google okkolgldfknecfjnhhglfopimelbaceh
- Look for your web app and copy the ID printed next to it.
- Run
./chromium-snap-desktop-generator.sh [id]
, with[id]
being replaced with your app's id.
./chromium-snap-desktop-generator.sh maonlnecdeecdljpahhnnlmhbmalehlm
- Open your app drawer and find your web app listed.
In order to prevent Chromium instances from being grouped with Chromium app launcher icons in the dock and to fix that Chromium opens a new icon in the dock when launched, add one line to Chromium's desktop launcher file.
Chromium's desktop file is located at /var/lib/snapd/desktop/applications/chromium_chromium.desktop
,
and thus you need to edit it with admin privileges (press Alt+F2 and paste the following command, or run
it from the command line):
gedit admin:///var/lib/snapd/desktop/applications/chromium_chromium.desktop
The following line is missing in Chromium for Snap's desktop file:
StartupWMClass=chromium
I suggest placing it in the [Desktop Entry]
group, so before [Desktop Action NewWindow]
.
When saved, launching Chromium from the dock won't create a second icon and make sure it's distinct from the other Chromium apps (say, the app launchers created with the script).