Prefix one more function listed together with aliases with 'function'
[abe:zshrc.git] / zsh.d / 04-grml-pre
1 # -*- sh -*-
2 # Do not warn about old skel dot-files anymore
3 GRML_WARN_SKEL=0
4
5 if which acpi > /dev/null; then
6     __tmp_acpi="`acpi 2>&1`"
7     if [ "$__tmp_acpi" = "" -o  \
8          "$__tmp_acpi" = "No support for device type: battery" \
9          -o "$HOST" = loadrunner ]; then
10         BATTERY=0
11     elif [ -n "$MC_SID" ]; then
12         BATTERY=0
13     else
14         BATTERY=1
15     fi
16 else
17     BATTERY=0
18 fi
19
20 EDITORS=(
21     emacs zile                 # emacs and good clones
22     nvi elvis-tiny vim vi      # vi and clones
23     jove jemacs mg qemacs vile # emacs and less preferred clones
24     nano pico                  # pico and clones
25     joe jupp                   # joe and clones
26     elvis                      # less preferred vi clones
27     editor edit                # Generic editors
28 )
29
30 for ed in $EDITORS; do
31     if which "$ed" > /dev/null; then
32         export EDITOR="$ed"
33         break
34     fi
35 done
36
37 if which emacsclient > /dev/null; then
38     export EDITOR="emacsclient -a $EDITOR"
39 fi
40
41 TEXTBROWSERS=(lynx links2 links elinks w3m)
42 XBROWSERS=(
43     conkeror                   # The can be only one ;-)
44     arora midori               # Preferred WebKit browsers
45     netsurf opera xlinks2      # Common alternative browsers
46     iceweasel firefox abrowser # Firefox bloat and clones
47     iceape seamonkey           # Conservative bloat and clones
48     chromium-browser           # At least it's open source
49     vimprobable                # vi keybindings, meh.
50     chimera2                   # New dinosaur
51     google-chrome              # The Evil Browser™ (if we don't count MSIE)
52 )
53
54
55 # Check which browsers are installed and use the most preferred one
56 for tb in $TEXTBROWSERS; do
57     if which "$tb" > /dev/null; then
58         export ABROWSER="$tb"
59         break
60     fi
61 done
62
63 BROWSER=""
64 if [ -z "$DISPLAY" ]; then
65     export BROWSER="$ABROWSER"
66 else
67     for xb in $XBROWSERS; do
68         if which "$xb" > /dev/null; then
69             export BROWSER="$xb"
70             break
71         fi
72     done
73     if [ -z "$BROWSER" ]; then
74         export BROWSER="$ABROWSER"
75     fi
76 fi