sonnyp / Junction

Application/browser chooser
https://flathub.org/apps/re.sonny.Junction
GNU General Public License v3.0
458 stars 29 forks source link

Host installation of Tor Browser Launcher not listed under Browsers #8

Closed de-abreu closed 2 years ago

de-abreu commented 2 years ago

Hi.

I've the Tor Browser Laucher launcher installed from Manjaro's official repositories. It's executable is at /usr/local/bin/torbrowser-launcher and its desktop file lies at /home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/start-tor-browser.desktop

Could it be listed as a browser option at Junction?

sonnyp commented 2 years ago

How did you install it?

Your desktop file is in the wrong place. It should be in ~/.local/share/applications.

Copy it or make a symbolic link.

de-abreu commented 2 years ago

I've installed it through pamac, torbrowser-launcher 0.3.5-2from the official repositories, not flatpak. On the other hand I installed junction 1.1.0 through flatpak.

I've created the following symlink in ~/.local/share/applications:

start-tor-browser.desktop -> /home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/start-tor-browser.desktop

But the Tor Browser still is not listed as a Browser option.

sonnyp commented 2 years ago

can you share cat ~/.local/share/applications/start-tor-browser.desktop ?

de-abreu commented 2 years ago

Sure, here it is:

#!/usr/bin/env ./Browser/execdesktop
#
# This file is a self-modifying .desktop file that can be run from the shell.
# It preserves arguments and environment for the start-tor-browser script.
#
# Run './start-tor-browser.desktop --help' to display the full set of options.
#
# When invoked from the shell, this file must always be in a Tor Browser root
# directory. When run from the file manager or desktop GUI, it is relocatable.
#
# After first invocation, it will update itself with the absolute path to the
# current TBB location, to support relocation of this .desktop file for GUI
# invocation. You can also add Tor Browser to your desktop's application menu
# by running './start-tor-browser.desktop --register-app'
#
# If you use --register-app, and then relocate your TBB directory, Tor Browser
# will no longer launch from your desktop's app launcher/dock. However, if you
# re-run --register-app from inside that new directory, the script
# will correct the absolute paths and re-register itself.
#
# This file will also still function if the path changes when TBB is used as a
# portable app, so long as it is run directly from that new directory, either
# via the shell or via the file manager.

[Desktop Entry]
Type=Application
Name=Tor Browser
GenericName=Web Browser
Comment=Tor Browser is +1 for privacy and −1 for mass surveillance
Categories=Network;WebBrowser;Security;
Exec=sh -c '"/home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/start-tor-browser" --detach || ([ !  -x "/home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k
X-TorBrowser-ExecShell=./Browser/start-tor-browser --detach
Icon=/home/user/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser/browser/chrome/icons/default/default128.png
StartupWMClass=Tor Browser
sonnyp commented 2 years ago

This is the weirdest desktop file. Anyway, MimeType is missing - you may want to report the issue upstream.

Add

MimeType=text/html;text/xml;application/xhtml+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;

to the desktop file, then run update-desktop-database ~/.local/share/applications and launch Junction

de-abreu commented 2 years ago

I will. I did what you suggested and now the Tor Browser is listed as an option. Though, it won't open the link passed, it'll just open the homepage. Do you know why that might be? Maybe a missing %u?

Edit: it seems this is a problem with the tor browser launcher. I'm not even able to open URLs with it via launching it through the command line. I'll close the issue.

sonnyp commented 2 years ago

Yes it's a missing %u but please figure that one out or talk to the packager.