Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open: Tries to open, not launch, desktop files and shows duplicates #26

Closed
louies0623 opened this issue Aug 1, 2023 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@louies0623
Copy link

louies0623 commented Aug 1, 2023

VirtualBox_PC-2_01_08_2023_15_41_43

@louies0623 louies0623 added the bug Something isn't working label Aug 1, 2023
@probonopd
Copy link
Member

It seems like you are trying to open a application/x-desktop file. Those should in fact be launched, not opened.

https://t.me/setlanguage/zh-hant-beta in Chrome asks whether to open this with xdg-open. Since we are not using xdg-open but our replacement open command, it gets passed to there. On my system, it asks to choose an application to open x-scheme-handler/tg MIME types. On my system, it doesn't find any. On your system, it appears to pick up a desktop file for an AppImage that can handle this scheme, but then tries to open rather than to launch that desktop file.

Probably we need to add checks to ensure that desktop files are always launched, even when they are passed to open.

@probonopd probonopd transferred this issue from helloSystem/ISO Aug 1, 2023
@probonopd
Copy link
Member

Additionally, we need to filter the list so that every entry is shown only once.

@probonopd probonopd changed the title Xdg open: Too many libreoffices in the list open: Tries to open, not launch, desktop files and shows duplicates Aug 1, 2023
@probonopd
Copy link
Member

Thanks @louies0623, please check if 0H352 and later improve this.

@louies0623
Copy link
Author

louies0623 commented Aug 1, 2023

Is it update from the update utilities?

@probonopd
Copy link
Member

No. The new version is at https://github.com/helloSystem/launch/releases and will be in helloSystem ISO 0H352 and later.

@louies0623
Copy link
Author

VirtualBox_PC-2_01_08_2023_17_27_14
It’s fixed, but libreoffice, transmission and Iridium are not installed, why are they still on it?

@probonopd
Copy link
Member

probonopd commented Aug 1, 2023

Probably the system doesnt find an application that can handle x-scheme-handler/tg and hence shows all applications that can handle any x-scheme-handler/*.

% find ~/.local/share/launch/MIME/x-scheme-handler_tg/ -not -type d
find: ~.local/share/launch/MIME/x-scheme-handler_tg/: No such file or directory

It this is the case, then it will show any

find ~/.local/share/launch/MIME/x-scheme-handler_*/ -not -type d

We probably will need some logic to put Telegram in there.
Is your system aware of it at all?

% find ~/.local/share/launch/Applications -not -type d | grep -i telegram

On my system it finds nothing because I don't have Telegram.

After downloading it from https://github.com/srevinsaju/Telegram-AppImage/releases and opening it in the Filer, now it shows:

% find ~/.local/share/launch/Applications -not -type d | grep -i telegram
~/.local/share/launch/Applications/Telegram_Desktop-x86_64.AppImage

If it finds something on your system, you could try:

mkdir -p ~/.local/share/launch/MIME/x-scheme-handler_tg/
ln -sf <path to what you found above> ~/.local/share/launch/MIME/x-scheme-handler_tg/

In my example:

% ln -sf ~/.local/share/launch/Applications/Telegram_Desktop-x86_64.AppImage ~/.local/share/launch/MIME/x-scheme-handler_tg/

As a result, https://t.me/setlanguage/zh-hant-beta indeed gets opened with Telegram.

Do you start to like the logic of our filesystem-based launch "database"?


So it seems that what is missing for this to be automatic is that a link to the AppImage needs to get placed into ~/.local/share/launch/MIME/x-scheme-handler_tg/ automatically.

@probonopd
Copy link
Member

probonopd commented Aug 1, 2023

% chmod +x ~/Downloads/Telegram_Desktop-x86_64.AppImage 
% ~/Downloads/Telegram_Desktop-x86_64.AppImage --appimage-extract
% cat squashfs-root/telegram.desktop
(...)
MimeType=x-scheme-handler/tg;
(...)

So, when encountering an AppImage, then "the system" (I still need to decide which component) needs to place the link to ~/.local/share/launch/MIME/.../ based on the information in MimeType= in the .desktop file inside the AppImage. (This already happens for .desktop files which are not inside AppImages.)

@probonopd
Copy link
Member

probonopd commented Aug 1, 2023

Note on privacy In order to use Signal or Telegram, you need a phone number. This number is shared with anyone you talk to while using these platforms, and can even be used to find you. This could be a problem if you're someone who doesn't want your conversations linked to your real-world phone number.

For this reason, I am not supporting these services. Until they provide a way to use them without a phone number.

@louies0623
Copy link
Author

louies0623 commented Aug 2, 2023

Most people use these software for work and to connect with family and friends, it is not easy to change, if the user does not need a phone to log in, then Kopete, FluffyChat, Caprine or Pidgin is an option.

@probonopd
Copy link
Member

Closing this as the original issue is solved.

The remaining issue will be discussed at

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants