#!/bin/sh
# Startup script for console if gpm and sudo are running
# You can change this script according to your own ideas and preferences
clear
echo "Netsurf-framebuffer-SDL-frontend 2.8:"
echo "   - A graphical www-browser for the Console and X"
echo "   - Netsurf-framebuffer is under development"
echo "    "
echo "What is it good for ?"
echo "   - Lightweightness & Graphics. No X needed"
echo "   - Extremely good page-layout for a Console web-browser"
echo "   - Mouse-wheel scrolling"
echo "    "
echo "Usability is pretty good for Console but still buggy:"
echo "   - Invisible text-cursor and some key-bindings missing"
echo "   - Auto-repeat of keys doesn't always function well"
echo "   - No page scaling, but chooseable startup resolutions"
echo "   - Local history thumbnails are all black"
echo "   - Sometimes pc freezes, especialy under X  !"
echo "   - No decent exit on Console. But you can use:"
echo "     ctrl+alt+f2 -and- killall netsurf-sdl -or- htop"
echo "    "
echo "You are warned hereby for occasional disfunktioning:"
echo "   - This software is only ment for an experimental test drive"
echo "   - So use Netsurf-SDL at your own risc"
echo "    "
echo "Press enter to continue or press ctrl/c to exit"
read key
while : ;do
  clear
  echo "*********************************"
  echo "* Choose NetSurf-SDL resolution *"
  echo "*********************************"
  echo "1.  640x480"
  echo "2.  800x600"
  echo "3. 1024x768"
  echo "0. Exit/Stop"
  echo "*********************************"
  echo -n "Enter your choice [0-3]: "
  read answer
  case $answer in
    1) gpm-stop;netsurf-sdl -w 640 -h 480 -b 16 ;;
    2) gpm-stop;netsurf-sdl -w 800 -h 600 -b 16 ;;
    3) gpm-stop;netsurf-sdl -w 1024 -h 768 -b 16 ;;
    0) ;;
    *) continue;;
  esac
  exit 0
done
