Lesson 14 of 19 ↓
- 1.Fedora + Distrobox + Arch + AUR Setup Guide
- 2.Enabling Hibernate on Linux
- 3.A Practical Git Workflow
- 4.Useful Linux Commands & Tips
- 5.Mirroring Your Android Screen with Scrcpy
- 6.Downloading Media with Yt-dlp
- 7.Consistent C/c++ Style with Clang-format
- 8.Auto-mounting Drives at Boot
- 9.Customizing Grub
- 10.Linux Swap Files Explained
- 11.Zram: Compressed Swap in Ram
- 12.Custom App Launch Behavior Via .desktop Files
- 13.Custom Mime Icons in Gnome
- 14.Fixing Missing Dock Icons (startupwmclass)
- 15.Installing Questasim for Hdl Simulation
- 16.Building Python 2 From Source
- 17.Auto-Starting WhatsApp and Telegram (Minimized or Tray)
- 18.Custom Neovim Configuration Guide
- 19.Running Windows Applications on Linux Seamlessly with WinBoat (Docker)
1 min read
Fixing Missing Dock Icons (startupwmclass)
Occasionally an app shows the right icon in the GNOME Applications menu, but once launched, the Dock displays a generic icon instead. That happens when GNOME can't match the running window to the app's .desktop file — usually because the window's WM_CLASS doesn't line up with what GNOME expects. Adding the correct StartupWMClass value fixes the mapping.
Find the Running App's Wm_class
Open GNOME's built-in debugger:
Alt + F2 → type "lg" → EnterThis opens Looking Glass. Go to the Windows tab, find the app in the list, and copy the value shown next to wmclass — for example:
wmclass: qpdfview.local.qpdfviewAdd it to the .desktop File
nvim ~/.local/share/applications/appname.desktopAdd this line inside the [Desktop Entry] section:
StartupWMClass=<wmclass>Example:
[Desktop Entry]
Name=qpdfview
Exec=qpdfview
Icon=qpdfview
StartupWMClass=qpdfview.local.qpdfviewUpdate the Desktop Database and Re-log
update-desktop-database ~/.local/share/applicationsLog out and back in for GNOME to pick up the change.
Result
GNOME now correctly matches the running window to its .desktop file, and the Dock shows the proper icon instead of a generic placeholder.
Why this happens: GNOME identifies running applications by a window's
WM_CLASS(or app ID). If that value doesn't match anything in the.desktopfile, the app is effectively "untracked" from the Dock's point of view. This is especially common with Qt applications, and can also show up when using a custom icon theme. It works the same way on both Wayland and X11.
Comments
Loading the discussion…