Following this reddit subforum [1] I've noticed I had same problem on my PC. In short if you try to launch a t.me/* link it will not open the link but fails with a KIOexec error. The simple way to handle with it is to remove the local desktop file and maintain only the one in /usr/share using the command [2]. This error was discovered with latest telegram (not tested with bin version) and plasma 5.22.2. References: [1] https://www.reddit.com/r/ManjaroLinux/comments/k76cph/telegram_not_launching_from_the_browser_xdgopen/ [2] rm -i "$(grep -l telegram ~/.local/share/applications/*.desktop)"
Desktop files are supplied upstream, but even right now this seems to be working just fine, using the open_generic() implementation of /usr/bin/xdg-open. It has some issues locating the "userapp-Telegram Desktop" file due to the space in the name (it breaks in /usr/bin/xdg-mime, line 299 and 301). Renaming it, and fixing the name in ~/.config/mimeapps.list, it finds the correct file and still works (tested with "xdg-mime query default x-scheme-handler/tg"). Are you sure it's added correctly to both the "Default Applications" *and* the "Added Associations" lists on your machine? So, it seems to be an issue with "kio open" or related to KDE somehow. Since this is all upstream behavior, I'll forward it upstream (assuming no issue about the matter exists yet), though we should consider why we wouldn't just patch out the desktop file/association creation downstream, since it's installed system-wide, anyway.
I have not checked for things are you saying. I can only confirm removing the user desktop fix it
If you can check the contents of ~/.config/mimeapps.list for me, that'd be great, since it might point to the issue. Alternatively, also check whatever xdg-mime returns. I've submitted the bug upstream, but it's not yet clear if this is some upstream or xdg-utils or Qt issue. See here: https://github.com/telegramdesktop/tdesktop/issues/16478
(In reply to Esteve Varela Colominas from comment #3) > If you can check the contents of ~/.config/mimeapps.list for me, that'd be > great, since it might point to the issue. Alternatively, also check whatever > xdg-mime returns. > > I've submitted the bug upstream, but it's not yet clear if this is some > upstream or xdg-utils or Qt issue. See here: > https://github.com/telegramdesktop/tdesktop/issues/16478 Sorry for late response, I was a bit busy: [Added Associations] application/octet-stream=org.kde.kate.desktop; application/pdf=firefox-bin-wayland.desktop; application/x-compressed-tar=org.kde.ark.desktop; application/x-extension-htm=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; application/x-extension-html=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; application/x-extension-shtml=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; application/x-extension-xht=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; application/x-extension-xhtml=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; application/xhtml+xml=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; application/xml=org.kde.kate.desktop; text/html=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; x-scheme-handler/chrome=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; x-scheme-handler/http=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; x-scheme-handler/https=firefox-bin.desktop;userapp-Firefox-QS9O20.desktop; x-scheme-handler/tg=userapp-Telegram Desktop-LPHB20.desktop;userapp-Telegram Desktop-UO3120.desktop; [Default Applications] application/octet-stream=org.kde.kate.desktop; application/pdf=firefox-bin-wayland.desktop; application/x-compressed-tar=org.kde.ark.desktop; application/x-extension-htm=firefox-bin.desktop application/x-extension-html=firefox-bin.desktop application/x-extension-shtml=firefox-bin.desktop application/x-extension-xht=firefox-bin.desktop application/x-extension-xhtml=firefox-bin.desktop application/xhtml+xml=firefox-bin.desktop application/xml=org.kde.kate.desktop; text/html=firefox-bin.desktop x-scheme-handler/callto=skypeforlinux.desktop x-scheme-handler/chrome=firefox-bin.desktop x-scheme-handler/discord-668477264995811338=nuclear.desktop x-scheme-handler/element=element-desktop.desktop x-scheme-handler/http=firefox-bin.desktop x-scheme-handler/https=firefox-bin.desktop x-scheme-handler/msteams=teams.desktop x-scheme-handler/skype=skypeforlinux.desktop x-scheme-handler/tel=skypeforlinux.desktop x-scheme-handler/tg=userapp-Telegram Desktop-UO3120.desktop x-scheme-handler/webcal=google-chrome.desktop x-scheme-handler/mailto=google-chrome.desktop
Created attachment 718926 [details] screenshot plasma 5.22.2 here, works fine.
tested firefox and chromium, and xdg-open.
I've cleaned the file and will see if i have any problem (probably the problem was born when i had removed Firefox and it's entries still were on the file)
@scardracs: Interesting, at least everything seems to be configured just fine. Then it might just be a difference in behavior between xdg-open's open_generic() and xdg-open's open_kde()/kio open @gyakovlev: That's weird, do you use KDE, and do you have a "userapp-Telegram Desktop" entry in your ~/.local/share/applications and ~/.config/mimeapps.list?
(In reply to Esteve Varela Colominas from comment #8) > @scardracs: > > Interesting, at least everything seems to be configured just fine. Then it > might just be a difference in behavior between xdg-open's open_generic() and > xdg-open's open_kde()/kio open > > @gyakovlev: > > That's weird, do you use KDE, and do you have a "userapp-Telegram Desktop" > entry in your ~/.local/share/applications and ~/.config/mimeapps.list? nothing there mentioning telegram, it just works for me =) yeah, using plasma full time.
Short update: The bug has been reported to KDE, as it seems Telegram's creation of this file to set Telegram to be the default handler for the tg:// protocol is "correct", since it can't rely on the presence/name of a global desktop entry for that. It creates the file and association using glib's AppInfo module. Upstream KDE report: https://bugs.kde.org/show_bug.cgi?id=439132 @gyakovlev: The fact telegram places a userapp-*.desktop in the local directory is what causes it to break. I'm not sure when it's created, but it seems to be whenever it detects the "Exec=" line of the currently default opener for the tg:// protocol doesn't match a runtime-generated string. This happens to force telegram to always be the default opener for tg:// links and seems to be the desired (cross-platform consistent) behavior by upstream. I think it's a bit excessive since it hampers people who desire to use multiple clients and pick their default client, but I'm not the one calling the shots, and it seems to be consistent with other IM clients like Discord and Teams, unfortunately.
Closing as it works now.
Thanks for checking!