如何为运行器和菜单创建 Tor 浏览器快捷方式?

如何为运行器和菜单创建 Tor 浏览器快捷方式?

这就是我已经做的事情:

tar -xf tor.tar.xz
mv tor-browser_en-US ~/.local/share/tor

之后,我尝试用两种不同的方式创建快捷方式。它们都导致了相同的错误:

第一次尝试

ln -s $HOME/.local/share/tor/start-tor-browser.desktop $HOME/.local/share/applications/start-tor-browser.desktop

第二次尝试

~/.local/share/tor/start-tor-browser.desktop --register-app

这两种方法确实都会创建一个图标。不过 Tor 浏览器根本无法打开。

start-tor-browser.desktop当我尝试直接从终端运行时,这是输出:

cd ~/.local/share/applications
./start-tor-browser.desktop
/usr/bin/env: ‘./Browser/execdesktop’: No such file or directory

更新

这是的内容start-tor-browser.desktop

#!/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/personal/.local/share/tor/Browser/start-tor-browser" --detach || ([ !  -x "/home/personal/.local/share/tor/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k
X-TorBrowser-ExecShell=./Browser/start-tor-browser --detach
Icon=/home/personal/.local/share/tor/Browser/browser/chrome/icons/default/default128.png
StartupWMClass=Tor Browser

答案1

我通过执行以下操作来实现此目的:

转到解压后的浏览器所在的目录,例如

cd /opt/tor-browser-linux64-10.5.8_de/tor-browser_en

然后执行

./start-tor-browser.desktop --register-app

这将复制start-tor-browser.desktop~/.local/share/applications

现在手动将其移动到~/Desktop

它现在出现在您的桌​​面上。右键单击使其可执行。通过启动浏览器尝试它是否基本正常工作。如果是,将其移回~/.local/share/applications并按下键盘上的“option(Windows)”键以启动 Ubuntu 的应用启动器视图。开始输入“tor”=> Tor 浏览器将出现。启动它,然后它将出现在左侧边栏中。右键单击图标并将其添加到收藏夹。就是这样。

相关内容