Creating XDG desktop files for web apps with Chromium
Posted on 2025-08-01
I use a lot of web apps. Most of them I run in Firefox, but there are occasions where I need to run them in another browser, specifically Chromium, for compatibility reasons. I'm looking at you, Microsoft Teams.
Chromium does technically have an "Install App" shortcut, but I'm guessing that permissions prevent it from adding an application shortcut to the appropriate XDG directories. I'm looking at you, Snap packages.
Anyways, I've found it helpful to create my own desktop files, and add them to ~/.local/share/applications/
. Here's the syntax for a simple desktop file that will launch a website in a Chromium app window:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=FragDev.com
Exec=/snap/bin/chromium --profile-directory=Default --app=https://fragdev.com
StartupWMClass=fragdev_window
I've stripped down most of the available configurations; removing StartupWMClass
caused the application launch to fail, at least in KDE, so I think it needs to be present.
Tags: browser