File: viewurl-mozilla.sh

package info (click to toggle)
licq 1.3.4-2etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,052 kB
  • ctags: 8,640
  • sloc: cpp: 76,924; sh: 9,845; ansic: 5,424; perl: 3,449; lex: 857; xml: 804; php: 691; makefile: 393; csh: 48
file content (56 lines) | stat: -rwxr-xr-x 1,425 bytes parent folder | download | duplicates (4)
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
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
#
# by Nicos Gollan <gtdev@spearhead.de>, 2003-01-31
#
# Used to open URLs in Mozilla, using Mozillas 'remote' function
# (see http://www.mozilla.org/unix/remote.html) to avoid opening
# new browser windows all over the place. Default is to open the
# requested site in a new tab. Configuration can be done via
# environment variables.
#
# Recognized environment variables:
#  - VURL_MOZILLA
#    Your mozilla binary. Defaults to 'mozilla'
#  - VURL_HOME
#    Your homepage. Defaults to 'www.licq.org'. This page is
#    opened if this script is called without parameters
#  - VURL_OPENMODE
#    Method of opening the URL.
#      "new-tab" - opens URL in a new tab (default)
#      "new-window" - opens URL in a new window
#      "current" - opens URL in the current window
#

if [ -z "${VURL_MOZILLA}" ]; then
  MOZILLA=mozilla
else
  MOZILLA=${VURL_MOZILLA}
fi

if [ -z "${VURL_HOME}" ]; then
  URLHOME='http://www.licq.org'
else
  URLHOME="${VURL_HOME}" 
fi

if [ -z "${VURL_OPENMODE}" ]; then
  OPENMODE=new-tab
else
  OPENMODE="${VURL_OPENMODE}"
fi

if [ "$1" = "" ] ; then
  URL=$URLHOME
else
  URL=$1
fi

if [ "${OPENMODE}" = "current" ]; then
  OPENSTRING="${URL}"
else
  OPENSTRING="${URL},${OPENMODE}"
fi

# If mozilla is already running, open the URL as new tab,
# otherwise launch a fresh copy of mozilla.
((${MOZILLA} -remote openurl\("${OPENSTRING}"\) ) ||  (${MOZILLA} "${URL}") & ) > /dev/null 2>&1