Fix silent launch failure for apps whose desktop id ends in .desktop (Telegram) - #6418
Conversation
gtk-launch only appends the .desktop suffix when the argument doesn't already end with it. Apps whose desktop id itself ends in .desktop -- notably Telegram (org.telegram.desktop.desktop) -- were therefore looked up as a nonexistent file and silently failed to launch from the menu, while every other app worked. Passing the full file name to gtk-launch resolves the entry unambiguously for both naming styles.
There was a problem hiding this comment.
Pull request overview
This PR fixes a Quickshell app-menu launch failure for desktop entry IDs that themselves end with .desktop (notably Telegram’s org.telegram.desktop), by ensuring gtk-launch receives the actual desktop file name (<id>.desktop) so the correct *.desktop file is resolved.
Changes:
- Update
AppLibrary.launch()to invokegtk-launchwithid + ".desktop"to handle IDs ending in.desktop. - Add a shell test assertion to prevent regressions for the
*.desktop.desktopresolution case.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| shell/services/AppLibrary.qml | Append .desktop when calling gtk-launch so IDs like org.telegram.desktop resolve correctly. |
| test/shell.d/app-search-test.sh | Add regression assertion confirming the launch command uses id + ".desktop". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Pass the full file name: gtk-launch only appends ".desktop" when the | ||
| // argument doesn't already end with it, so ids that themselves end in | ||
| // ".desktop" (e.g. org.telegram.desktop) would otherwise never resolve. |
There was a problem hiding this comment.
Reworded in 432a422 — now says "the file name with its extension".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
test/shell.d/app-search-test.sh:109
- The assertion message says "full file name", which can still be read as implying a filesystem path. For consistency with the in-code comment ("file name with its extension"), consider rewording the test message to explicitly mention the extension instead of "full".
'app library launches by full file name so ids ending in .desktop (org.telegram.desktop) resolve'
Fix silent launch failure for apps whose desktop id ends in ".desktop" (Telegram)
Problem
Since the quattro shell, Telegram cannot be launched from the app menu at all: selecting it shows the "Launching Telegram…" OSD, then nothing happens. No process is spawned and nothing is logged. Launching
/usr/bin/Telegramfrom a terminal works fine, and reinstalling the package doesn't help (see #6312, closed for lack of detail — this is that bug).Root cause
AppLibrary.launch()runsgtk-launch <entry.id>. Quickshell'sDesktopEntry.idis the desktop file basename with the final.desktopextension stripped, so for Telegram'sorg.telegram.desktop.desktopthe id isorg.telegram.desktop.gtk-launch(both GTK3 and GTK4) only appends the.desktopsuffix when the argument doesn't already end with it. Since Telegram's id itself ends in.desktop, gtk-launch treats it as a complete file name and looks for a file literally namedorg.telegram.desktop, which doesn't exist:The error is discarded by
execDetached, so the failure is completely silent. Telegram is typically the only installed app with a reverse-DNS id ending in.desktop, which is why everything else launches normally.Fix
Pass the full file name to gtk-launch by appending
.desktopto the id. This is unambiguous for both naming styles:bitwarden→bitwarden.desktop✅ (same result as before)org.telegram.desktop→org.telegram.desktop.desktop✅ (previously broken)Also adds a regression assertion to
test/shell.d/app-search-test.sh.Testing
bash test/shell.d/app-search-test.sh— all 21 assertions pass, including the new one.gtk-launch org.telegram.desktopreproducibly fails,gtk-launch org.telegram.desktop.desktoplaunches Telegram; with the patched shell the menu launches Telegram again.