summaryrefslogtreecommitdiffstats
path: root/quanta/scripts/externalpreview.sh
blob: 9bc67fa744bfd65b80a65b4d1c06a2dac24fe6b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#Previews the current document in Mozilla/Netscape/Opera, depending
#on the last two arguments (browsername, newtab command).
#Might be adjusted in the feature to support more browsers.
pid=$1
currentURL=""
if test $pid == "unique"
then
  currentURL=`dcop quanta WindowManagerIf saveCurrentFile`
  shift
else
  currentURL=`dcop quanta-$pid WindowManagerIf saveCurrentFile`
fi
browser=$2
newTab=$3
if test $currentURL
then
  if ! $browser -remote "openURL($currentURL,$newTab)"
  then
    $browser $currentURL
  fi
fi