aboutsummaryrefslogtreecommitdiff
path: root/tor-browser
blob: 4c8a67f93b61af2e6273243dfa93cb684458f61a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
# Wrapper for the Tor Software Bundle
#

# Parameters
BASENAME="`basename $0`"

# Prefer torbrowser-launcher
if which torbrowser-launcher &> /dev/null; then
  FOLDER="$HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser"

  # Sync vimperator config
  if [ -e "$HOME/.vimperator" ] && [ -d "$FOLDER" ] && [ ! -e "$FOLDER/.vimperatorrc" ]; then
  (
    cd "$FOLDER"
    ln -s "$HOME/.vimperator"
    ln -s "$HOME/.vimperatorrc"
  )
  fi

  # Launch the other wrapper, forcing default locale.
  mkdir -p $FOLDER/Logs
  LC_ALL=C torbrowser-launcher &> $FOLDER/Logs/torbrowser-launcher.log &
else
  # Classic mode
  ARCH="`uname -m`"

  if [ "$ARCH" == "i386" ]; then
    ARCH="linux32"
  elif [ "$ARCH" == "i686" ]; then
    ARCH="linux32"
  elif [ "$ARCH" == "x86_64" ]; then
    ARCH="linux64"
  fi

  FOLDER="$HOME/apps/tor-browser/$ARCH"

  if [ -d "$FOLDER" ]; then
    mkdir -p $FOLDER/Logs
    cd $FOLDER
    $FOLDER/start-tor-browser.desktop &> $FOLDER/Logs/tor-browser.log &
  else
    echo "Please download Tor Browser using tor-browser-dl or torbrowser-launcher first."
  fi
fi