browser-next-form-field: skip non-visible elements
[conkeror.git] / contrib / run-conkeror
blob1006c36f66a01edd0180feae860835526b58b5f8
1 #! /bin/bash
3 # (C) Copyright 2008 John J. Foerch
5 # Use, modification, and distribution are subject to the terms specified in the
6 # COPYING file.
8 # This bash script can be used to launch conkeror on *nix systems that
9 # support symlinking. Create a symlink to this script in a directory
10 # in your executable search path.
12 # For example:
14 # sudo ln -s /path/to/conkeror/contrib/run-conkeror /usr/local/bin/conkeror
17 # Hopefully, it will correctly find your xulrunner installation, and
18 # the location of your conkeror install.
21 ## chase a symlink
22 function chase () {
23 x="$1"
24 while :
25 do
26 last="$x"
27 x=$(find "$x" -maxdepth 0 -printf "%l")
28 [ -z "$x" ] && {
29 echo $last
30 return 1
32 done
35 ## search in a gre dir for the first xulrunner 1.9 install location
37 ## to be robust, we would need to examine each candidate xulrunner and
38 ## find a valid one. for now we just take the first and accept our
39 ## doom.
41 function check-gre () {
42 grep -h GRE_PATH $(grep -l '\[1\.9' "${1%/}"/*.conf) | cut -d= -f2 | head -n 1
45 if [[ -d "$HOME/.gre.d" ]]; then
46 xr=$(check-gre "$HOME/.gre.d" 2>/dev/null)
49 if [[ -z "$xr" ]]; then
50 if [[ -d "/etc/gre.d" ]]; then
51 xr=$(check-gre /etc/gre.d 2>/dev/null)
55 if [[ -z "$xr" ]]; then
56 echo "Xulrunner not found"
57 exit 1
60 thisscript=$(chase $0)
61 contrib=${thisscript%/*}
62 conkeror=${contrib%/*}
64 exec "${xr%/}"/xulrunner "$conkeror"/application.ini "$@"