3
0
Fork 0
forked from mirrors/nixpkgs

torbrowser: wrapper improvements

This brings the wrapper closer to the upstream wrapper.

Briefly,
- exec to prevent the shell from hanging around
- do not connect to session manager
- set WM_CLASS to "Tor Browser"
- use fonts.conf from the torbrowser bundle
This commit is contained in:
Joachim Fasting 2016-04-29 18:42:09 +02:00
parent 85aece2f8e
commit c3f54960c6
No known key found for this signature in database
GPG key ID: 4330820E1E04DCF4

View file

@ -50,15 +50,17 @@ stdenv.mkDerivation rec {
cp -R * $out/share/tor-browser
cat > "$out/bin/tor-browser" << EOF
#!${stdenv.shell}
#! ${stdenv.shell}
unset SESSION_MANAGER
export HOME="\$HOME/.torbrowser4"
if [ ! -d \$HOME ]; then
mkdir -p \$HOME && cp -R $out/share/tor-browser/Browser/TorBrowser/Data \$HOME/ && chmod -R +w \$HOME
echo "pref(\"extensions.torlauncher.tordatadir_path\", \"\$HOME/Data/Tor/\");" >> \
~/Data/Browser/profile.default/preferences/extension-overrides.js
fi
export FONTCONFIG_PATH=\$HOME/Data/fontconfig
export LD_LIBRARY_PATH=${libPath}:$out/share/tor-browser/Browser/TorBrowser/Tor
$out/share/tor-browser/Browser/firefox -no-remote -profile ~/Data/Browser/profile.default "\$@"
exec $out/share/tor-browser/Browser/firefox --class "Tor Browser" -no-remote -profile ~/Data/Browser/profile.default "\$@"
EOF
chmod +x $out/bin/tor-browser