Fixing desktop shortcut of Lagrange

I have been using Lagrange to browse Gemini after moving to elementary. It’s beautiful and integrates well with the desktop. A minor issue has been bothering me with Lagrange though. Its the duplicate icon on the Plank whenever Lagrange was invoked.

Perhaps its not annoying for any other user or nobody else uses it on elementary because there were no related issues in their github repo. It took me a while to find the exact option to add in the desktop shortcut that makes this particular problem go away. We need to find the WM_CLASS name for the application by running xprop WM_CLASS in the terminal. This will change the cursor to a cross and then we poke the desired application with this cross - which in my case is Lagrange. The terminal will now show the WM_CLASS name for the application. For Lagrange, it was simply ‘lagrange’.

Once we have the WM_CLASS name, we just need to add this line to the desktop shortcut: StartupWMClass=lagrange

Only problem? I can’t figure out where Flatpak keeps the shortcut. Even adding a shortcut in the usual location ~/local/share/applications proved ineffective. A little duckduckgo later, Arch wiki (all hail arch wiki), shines a light on the mystery. The flatpak desktop shortcuts (its a symlink) reside in ~/.local/share/flatpak/exports/share/applications.

Here’s the shortcut file now:

[Desktop Entry]
Name=Lagrange
Comment=A Beautiful Gemini Client
Categories=Network
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=/app/bin/lagrange --file-forwarding fi.skyjake.Lagrange @@u %U @@
Terminal=false
Type=Application
StartupWMClass=lagrange
Icon=fi.skyjake.Lagrange
MimeType=x-scheme-handler/gemini;x-scheme-handler/gopher
X-Flatpak=fi.skyjake.Lagrange

and the dock:

Logging out, logging back in and adding the shortcut to the Dock once again fixed the annoyance. There’s a chance that when Lagrange updates next time, the changes might go away. For now, I have kept a copy in ~/local/share/applications to deal with it.

Related posts

My desktop

I have been thinking of making this list of the applications I use on a daily basis for quite some time but I got the motivation to finish it up…

Lagrange and Amfora

Almost wrote the title as Lagrange vs. Amfora but then I realized I like them both and there’s no real downside to any of these. I also use them alternately…