File: help_script.sh

package info (click to toggle)
bless 0.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,960 kB
  • sloc: cs: 15,261; xml: 1,954; sh: 18; makefile: 15; python: 4
file content (25 lines) | stat: -rwxr-xr-x 870 bytes parent folder | download
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
#!/bin/sh

base_dir="$1"
docbook_help="$base_dir/index.docbook"
html_help="$base_dir/index.html"

# try to get default browsers from GConf
GCONFTOOL=$(which gconftool-2 2> /dev/null)

if [ -n "$GCONFTOOL" ];
then
    help_browser=$("$GCONFTOOL" --get "/desktop/gnome/url-handlers/ghelp/command")
    help_browser=$(echo "$help_browser" | sed s/\"//g)
    http_browser=$("$GCONFTOOL" --get "/desktop/gnome/url-handlers/http/command")
    http_browser=$(echo "$http_browser" | sed s/\"//g)
fi

# some other browsers
yelp_browser=$(which yelp 2> /dev/null)
firefox_browser=$(which firefox 2> /dev/null)

([ -n "$help_browser" ] && $(printf "$help_browser" "$docbook_help")) ||
([ -n "$yelp_browser" ] && "$yelp_browser" "$docbook_help") ||
([ -n "$http_browser" ] && $(printf "$http_browser" "$html_help")) ||
([ -n "$firefox_browser" ] && "$firefox_browser" "$html_help")