slitaz-tools view tinyutils/browser @ rev 1011
Add sdt SliTaz Distro Tracker
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Feb 11 23:41:23 2017 +0100 (2017-02-11) |
parents | 5d80f6fdbdb7 |
children |
line source
1 #!/bin/sh
2 # Launch SliTaz default Web browser.
3 #
5 . /etc/slitaz/applications.conf
7 USER_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/slitaz/applications.conf"
8 [ -f $USER_CONFIG ] && . $USER_CONFIG
10 EXEC="exec setsid $BROWSER"
12 [ "$(which $BROWSER)" ] || case "$1" in
13 file://*)
14 exec xterm -e "sh -c \"sed 's/<[^>]*>//g;s/</</g;s/>/>/g;s/&/\\&/g' < ${1#file://} | uniq | less\""
15 esac
17 if [ -z "$XAUTHORITY" ]; then
18 # console session
19 EXECT="$BROWSER"
20 else
21 # Xorg session
22 case $BROWSER in
23 links) EXECT="$EXEC -g" ;;
24 *) EXECT="terminal -e $BROWSER" ;;
25 esac
26 fi
28 case $BROWSER in
29 *links*|retawq|lynx) $EXECT $@ ;;
30 w3m) $EXECT -N $@ ;;
31 qupzil*) $EXEC -ow $@ ;;
32 *) $EXEC $@ ;;
33 esac
35 exit 0