#!/bin/bash
# Small script for Wikipedia, dict
source /usr/local/lib/inx/inx_essentials
maybe_switch

entry () 
    { 
    echo ; bold
    head-col ; echo -e "\n  Enter your search terms:" 
    white ; echo  
    printf "  "
    read
    }

unbold ; clear ; bold
fig-col
echo -e "\n  Reference\n"

head-col
echo -e "\n  Look something up...\n"
info-col
echo "  1: On Wikipedia (text browser - elinks)"
echo "  2: On Wikipedia (graphical browser - xlinks2)"
echo "  3: On dict.org  (dictionary - 'dict' in the 'less' pager)"
echo
head-col
echo "  m: Main menu"
echo "  w: Net & Web menu"
echo "  o: Office menu"
echo "  x: Quit"
echo
unbold
read -s -n 1 REF
case $REF in
    1)
    entry
    wiki "$REPLY"
    exec reference
    ;;
    2)
    if [ "$TERM" != "linux" ] && [ "$DISPLAY" = "" ] ; then
        bold ; white
        echo -e "\n  Sorry, the graphical browser does not run from Screen or dvtm."
	sleep 4
	exec reference
    fi	
    entry    
    wikig "$REPLY"
    exec reference
    ;;
    3)
    entry    
    dict "$REPLY" | less
    exec reference
    ;;
    m|M)
    exec menu    
    ;;
    w|W)
    exec netinx
    ;;
    o|O)
    exec office
    ;;
    x|X)
    echo
    exit
    ;;
    *)
    exec reference
    ;;
esac 
