#!/bin/bash

# This script will install additional educational software in addition to a standard (L)ubuntu installation 
# (has to be installed before) and optimize the system by settings

# Please check if this installscript was made executable (properties -> permissions -> Tick "Execute   Allow executing file as a program)
# copy&paste file to desktop; open a terminal (press STRG/CTL and Alt and T the same time)
# To answer the questions during installation the best option to press ENTER, 
# This script will need some time, but it worth to wait ;)

# Some lines are inactived by a "#" in front of the line. 
# Remove "#" if you want to run these lines and store file.

# Please refer to the documentation of this script to get a list if settings, which this script does NOT solve.

# Version: for Ubuntu 20.04 LTS / 22.04 LTS / Linux Mint 22 - Ubuntu 24.04 LTS

# create user student as standard user for pupils and sets password of student as "labdoo"
echo "Create user student"
sudo useradd --create-home --password $(perl -e 'print crypt("labdoo", "aa")') -g labdoo student 

# Update
sudo apt-get dist-upgrade -f -y
sudo apt-get aptitude aptitude-doc-en -y 
sudo apt-get gksu -y

#------tools to optimize performance ----------------------
sudo apt-get install preload -y

#-----ClamAV Virus Scanner-------------------
# sudo apt-get install clamav clamav-freshclam clamav-docs clamtk -y
# sudo freshclam

#-----------USB start media creator and unetbootin---------------
sudo apt-get install usb-creator-common usb-creator-gtk -y

# sudo add-apt-repository ppa:gezakovacs/ppa -y
# sudo apt-get update -y 
# sudo apt-get install unetbootin -y

#---------- install Java JDK ------------
# sudo apt-get install openjdk-17-jre -y  # Ubuntu 20.04 LTS
sudo apt-get install openjdk-18-jre -y  # Ubuntu 22.04 LTS

#-----------install MATE desktop---------
# sudo apt-get install ubuntu-mate-desktop -y
# sudo snap ubuntu-mate-welcome --classic -y

sudo snap set system refresh.retain=2  # limit max. 2 old versions of a snap based program

#------------gnome-system-tools (eg for configuring user rights--------------
sudo apt-get install gnome-system-tools -y

#----------- LightDM greeter / log-in ----------------------
sudo apt-get install lightdm slick-greeter lightdm-gtk-greeter lightdm-gtk-greeter-settings -y

#------lxtask Task manager tool  ----------------------
sudo apt-get install lxtask -y

#------nautilus fila manager  ----------------------
sudo apt install nautilus nautilus-share -y

#------editor  ----------------------
sudo apt install mousepad -y

#------LXDE Desktop ----------------------
# sudo apt-get install lxde obconf -y

#------apt offline update tool  ----------------------
sudo apt-get install apt-offline -y

#------net-tools---------------------------
sudo apt-get install net-tools -y

#------Ubuntu Software Center  ----------------------
sudo apt-get install ubuntu-software -y

# installation of support module for older WiFi cards / Linux Backport Module
# Installation des Linux Backport Moduls mit Treibern für ältere Hardware, u.a. WLAN Karten
sudo apt-get install linux-backports-modules-cw-3.6-$(grep CODE /etc/lsb-release | cut -c18-28)-$(uname -r | cut -c10-23)  -y   # for ubuntu 12.04 and higher
sudo apt-get install b43-fwcutter firmware-b43-installer bcmwl-kernel-source linux-firmware-nonfree -y  # non-free drivers incl. b43 firmware

# inxi system information tool
sudo apt-get install inxi -y

# pigz, needed for adding additional content after installation by script installscript-content.sh
sudo apt-get install pigz -y

# installation of linux-firmware-nonfree (often for WiFi cards / häufig für WLAN Karten)
sudo apt-get install linux-firmware-nonfree -y

# optional: preparation to install support modules for older WLAN/WiFi cards
# you have to find and download the .exe or .inf driver for your specifiv WiFi card separatly
# optional: Vorbereitung um manuell die spezifischen Treiber (.exe oder .inf) zu laden und zu installieren
# for further details refer to the installation manual. Für weitere Details lesen Sie das Installationsmanual.
sudo apt-get install cabextract unshield -y
sudo apt-get install ndiswrapper-utils-1.9 ndiswrapper-common ndisgtk -y
sudo apt-get install dkms ndiswrapper-dkms -y

# Installation Edubuntu educational software
sudo apt-get install ubuntu-edu-preschool ubuntu-edu-primary ubuntu-edu-secondary ubuntu-edu-tertiary -y

# installation GSMART tool (disc management / Festplattenmanagement)
sudo apt-get install smartmontools -y
sudo apt-get install gsmartcontrol -y

# as pulseaudio became part of lubuntu 16.10 ff.
sudo apt-get install pavucontrol -y
sudo apt-get install gstreamer1.0-pulseaudio -y
sudo apt-get install libsdl1.2debian pulseaudio-module-gconf pulseaudio-module-lirc pulseaudio-module-x11 pulseaudio-module-zeroconf -y

# remove medibuntu because ended
 sudo rm /etc/apt/sources.list.d/medibuntu.list

# installation GParted Partion Manager
sudo apt-get install gparted -y

# package manager synaptic
sudo apt-get install synaptic -y

# useful hardware information tool
sudo apt-get install hardinfo -y

# sensor control, yad and stress
sudo apt-get install stress psensor yad -y

# advanced monitor settings
sudo apt-get install arandr -y

# installation automatic time syncronization via web
sudo apt-get install ntp  -y

#  install network utils (Samba, Windows server, only client, not server)
sudo apt-get install cifs-utils -y

#  install Samba / Windows server)
sudo apt-get install samba -y

#  install add für Samba / Windows share for file manage Caja)
sudo apt-get install caja-share -y

#  install stress tool (put stress / workload to a computer for testing purposes)
sudo apt-get install stress -y

# installation of DKMS and build-esential to automatic software release control
sudo apt-get install build-essential dkms -y

# installation of libreoffice office suite
sudo apt-get install libreoffice libreoffice-l10n-de -y

# installation of simplescreenrecorder
sudo apt-get install simplescreenrecorder -y

# installation of gimp
sudo apt-get install gimp gimp-help-de language-pack-gnome-de gimp-help-es language-pack-gnome-es gimp-help-fr language-pack-gnome-fr gimp-dcraw gimp-ufraw gimp-gap gimp-gutenprint gimp-plugin-registry -y

# installation of CUPS Common Unix Printing System
sudo apt-get install cups cups-client cups-bsd hplip hpijs printer-driver-gutenprint -y

# optional: additional educational and game software, good rated, not much space used
sudo apt-get install gnome-games -y # games collection
sudo apt-get install geogebra -y # (136 MB) Math tool, formerly part of Edubuntu [01.2019 version from homepage www.geogebra.org installed, version from Ubuntu repository not used anymore as incompatible with Java release]
sudo apt-get install klavaro -y  # keyboard trainer
sudo  apt-get install kgeography -y # world map game
sudo  apt-get install littlewizard -y # programing for kids
sudo apt-get install pingus -y # (25 MB), pinguins game
sudo apt-get install sgt-puzzles -y # game set
sudo apt-get install pianobooster -y # learning piano
sudo apt-get install freeplane -y # mind manager 
sudo apt-get install gpaint -y # Paint program
sudo apt-get install vym -y # mind manager
sudo apt-get install kalgebra -y # Kalgebra math tool
sudo apt-get install gtick kmetronome timidity -y # software metronom
sudo apt-get install nanny -y # parental control of computer usage
sudo apt-get install kino mjpegtools dvgrab ffmpeg2theora -y # video capture tool
sudo apt-get install tuxguitar tuxguitar-jsa  tuxguitar-alsa  lilypond -y # guitar playing
sudo apt-get install solfege -y # music exercises
sudo apt-get install marble -y # offline world map
sudo apt-get install etoys etoys-doc -y # A media-rich model, simulation construction kit and authoring tool
sudo apt-get install plm -y # Programming exerciser in Java, Python, Scala and others
sudo apt-get install tkgate -y # Tcl/Tk based digital circuit editor and simulator
sudo apt-get install turtleart -y # a LOGO-like tool for teaching programming
sudo apt-get install scolasync -y # graphic tool to copy data to or from a set of USB storage media
sudo apt-get install xabacus -y # simulation of the ancient calculator (plain X version)
sudo apt-get install vmpk -y # Virtual MIDI Piano Keyboard
sudo apt-get install jfractionlab -y # Educative program to practice fractions
sudo apt-get install pysiogame -y # educational activity pack for kids
sudo apt-get install anki -y # (Anki vocabulary learning tool)
sudo apt-get install frozen-bubble ltris bumprace lbreakout2 biniax2 neverball gbrainy supertux  scratch eboard gnuchess crafty minetest -y # more games for Lubuntu
sudo apt-get install extremetuxracer extremetuxracer-data -y # racer
sudo apt-get install tuxpaint -y # tuxpaint
sudo apt-get install tuxmath -y # tuxmath
sudo apt-get install numptyphysics -y # Numpty Physik
sudo apt-get install scratch -y # MIT scratch tool

# optional recommended KDE educational programs
sudo apt-get install step -y # physic laboratory
sudo apt-get install cantor -y # 
sudo apt-get install kalzium -y # chemistry
sudo apt-get install khangman -y # 
sudo apt-get install kig -y # 
sudo apt-get install klettres -y # 
sudo apt-get install kmplot -y # 
sudo apt-get install khelpcenter -y # 
sudo apt-get install kstars -y # astronomy
sudo apt-get install ktouch -y # 
sudo apt-get install kturtle -y # 
sudo apt-get install kwordquiz -y # 
sudo apt-get install parley -y # 
sudo apt-get install rocs -y # 
sudo apt-get install kdeedu -y #

# Childsplay game collection, needs local language add-on
sudo apt-get install childsplay childsplay-alphabet-sounds-de -y

# GCOMPRIS gamecollection
# sudo snap install gcompris

#video, filezilla tools not being part of the Linux Mint distro
sudo apt-get install guvcview -y #
sudo apt-get install cheese -y #
sudo apt-get install filezilla -y #

#optional CAD software for technical educational
sudo apt-get install freecad -y # FreecAD
sudo apt-get install librecad -y # LibreCAD

# optional Audio software
sudo apt-get install audacity easytag -y # Audacity

# optional pdf tools
sudo apt-get install pdfsam pdfshuffler -y # pdf Split and Merge, PDF shuffler

#--------Addons for blind or handicapped users-----------------------
sudo apt-get install reiserfsprogs -y  #Add reiser file system used in Knoppix
sudo apt-get install gnome-orca -y  #screen reader Orca
sudo apt-get install kmag -y # magnifying glass
sudo apt-get install bluefish -y # HTML Editor
sudo apt-get install ceni -y # text based Network Manager
sudo apt-get install eviacam onboard -y # eye tracking eviacom onboard virtual keyboard
sudo apt-get install mbrola mbrola-de6 mbrola-de7 mbrola-de4 mbrola-de5 -y # # synteic speaker packages
# sudo apt-get install espeak espeak-gui -y # espeek tool and generator
# sudo apt-get install freetts flite -y # speech synthesis system
# sudo apt-get install festival festival-doc festival-freebsoft-utils -y # elektronische Sprachen
# sudo apt-get install festvox-kallpc16k festvox-kdlpc16k -y # american speaker
# sudo apt-get install festvox-us1 festvox-us2 festvox-us3 -y # american speaker for Mbrola
# sudo apt-get install festvox-rablpc16k festvox-en1 festvox-don -y # british speaker
#optional various speaker or language / rules, please activate the lines you need
# sudo apt-get install festvox-suopuhe-common festvox-suopuhe-lj -y # finnish speaker
# sudo apt-get install festvox-czech-dita festvox-czech-krb festvox-czech-machac festvox-czech-ph -y # czech speaker
# sudo apt-get install festvox-ellpc11k -y # castilian speaker
# sudo apt-get install festvox-ru -y # russian speaker
# sudo apt-get install festvox-hi-nsk -y # hindi speaker
# sudo apt-get install festvox-mr-nsk -y # Marathi speaker
# sudo apt-get install festvox-te-nsk -y # Teluga (te) speaker
# sudo apt-get install festvox-italp16k festvox-itapc16k -y # italian speaker

sudo apt-get install gwget -y # text based Download Manager
sudo apt-get install pcmanfm gvfs-backends -y # text based Fast File Manager
sudo apt-get install alpine -y # text oriented e-mail tool
sudo apt-get install irssi  irssi-plugin-otr  irssi-plugin-xmpp -y # text based IRC client
# irssi-plugin-silc not found
sudo apt-get install lynx lync-common -y # text based web browser in a terminal
sudo apt-get install elinks cclive -y # text based browser
sudo apt-get install mc gpm -y # midnight commander text based file manager
sudo apt-get install easystroke -y # mouse / gesture controlled user interface
sudo apt-get install dasher -y # text input
sudo apt-get install cellwriter -y # hand written text converter
sudo apt-get install sitplus -y # ludic-therapeutic activities
sudo apt-get install libttspico-utils sox xsel ffmpeg -y # SVOX - pico2wave
sudo apt-get install gnome-accessibility-themes -y # high accessibility themes for visually impaired users.
#--------end of additional programs for disabled, blind or nearly blind users ----

#------- Add remote desktop and VPN tools ---------------
sudo apt-get install rdesktop krfb krdc -y
#--------------------------------------------------------

#------- Add Netsurf and Firefox browser-----------------
# sudo apt-get install firefox language-pack-de-base language-pack-en-base -y language-pack-es-base -y language-pack-fr-base -y
sudo apt-get install netsurf -y
#----------- end of Firefox installation -------

# ------------installation of virtualbox, be aware of further adaptions needed, refer to ------
# http://wiki.ubuntuusers.de/VirtualBox/Installation and
# http://wiki.ubuntuusers.de/VirtualBox/Benutzung; 
# remove "#" if installation wanted; OSE version from ubuntu package:
 sudo apt-get install virtualbox-ose virtualbox-ose-qt virtualbox-ose-dkms virtualbox-ose-guest-dkms virtualbox-ose-modules-generic -y
 sudo adduser labdoo vboxusers  # adds user labdoo to group vboxusers
 sudo adduser student vboxusers  # same for student, if you need 2nd user student / wenn 2. Benuter student
 sudo apt-get install virtualbox-guest-additions-iso -y # installation of guest extensions (in each guest OS like Windows you have to install and activate the guest extensions, too! Refer to installation manual)
# ------- end of VirtualBox ---------------------

#------ additional for lubuntu 12.04 LTS as missed in 12.04 ------------
sudo apt-get install xterm -y
sudo apt-get install calibre -y
#----------------------------------------------------------------------

#------ additional plugins for Evolution PIM 20.04 LTS ff. ------------
sudo apt-get install evolution-plugins-experimental mail-notification-evolution evolution-ews -y
#----------------------------------------------------------------------

# This part will download codecs and additional multimedia software and store it locally in /home/labdoo/Downloads
# IMPORTANT: check the legal situation in your country concerning codecs! In some countries it is not allowed t use these codecs!
#----------------------------------
echo "# Adding repositories for adding videocodecs" >> /etc/apt/sources.list
echo "deb http://download.videolan.org/pub/debian/stable/ /" >> /etc/apt/sources.list
echo "deb-src http://download.videolan.org/pub/debian/stable/ /" >> /etc/apt/sources.list
wget -O - http://download.videolan.org/pub/debian/videolan-apt.asc | sudo apt-key add -
# Renew the repository list
apt-get update
#---------------------------------

# downloading restricted Codecs, refer to https://help.ubuntu.com/community/RestrictedFormats
# Use environment variable $DESKTOP_SESSION to determine which desktop is in use
# case $DESKTOP_SESSION in
# "ubuntu")  echo "You are using Ubuntu"
           sudo apt-get install --download-only ubuntu-restricted-extras -y
#           ;;
# "xubuntu") echo "You are using XUbuntu"
#           sudo apt-get install --download-only xubuntu-restricted-extras -y
#           ;;
# "lubuntu") echo "You are using LUbuntu"
#           sudo apt-get install --download-only lubuntu-restricted-extras -y
#           ;;
# "kubuntu") echo "You are using KUbuntu"
#           sudo apt-get install --download-only kubuntu-restricted-extras -y
#           ;;
# case

# Determine actual version
VERSION=`lsb_release -r|awk {'print $2'}`
# Split version number in major and minor parts to make comparison.
MAJOR_VERSION=`echo $VERSION|awk -F\. {'print $1'}`
MINOR_VERSION=`echo $VERSION|awk -F\. {'print $2'}`
if [ $MAJOR_VERSION -le 15 ]
 then
  if [ $MINOR_VERSION -lt 10 ]
   then
    # execute if release <= 15.04
    echo "Your version is less than 15.10"
    sudo apt-get install --download-only libdvdread4 -y
   else
    # execute >= 15.10
    echo "Your version is 15.10"
    sudo apt-get install --download-only libdvd-pkg -y
  fi
 else
  echo "Your version is above 15.10"
  sudo apt-get install --download-only libdvd-pkg -y
fi
#--------------------------------------------------------------------------

#------------add WINE to run Windows programs ---------------------
sudo apt-get install wine-stable winetricks -y
sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install wine32 -y # enable 32 bit Windows programs to run on 64 bit Linux, needs ca. 500 MB
#------------------------------------------------------------------

#------------add VLC and Mplayer video player---------------------
sudo apt-get install vlc -y # video player
sudo apt-get install mplayer mplayer-gui mplayer-fonts mplayer-skins mplayer-doc -y # video Mplayer
sudo apt-get install mirage -y # picture viewer
#----------------------------------------------------------------

# install language pack english (always) and local languages (optional), set # in front of lines not needed
# Installieren des englischen Sprachenpakets (immer) und von lokalen Sprachen (optional), mit # vor den Zeilen inaktivieren
# usefull language codes, see http://www.loc.gov/standards/iso639-2/php/English_list.php or ubuntu manuals / 
# nützliche Sprachcodes: 
# english / Englisch (en):
sudo apt-get install $(check-language-support -l en) -y
# Deutsch / German (de-de):
sudo apt-get install $(check-language-support -l de) -y
# Spanish / Spanisch (es):
sudo apt-get install $(check-language-support -l es) -y
# French / Französisch (fr):
sudo apt-get install $(check-language-support -l fr) -y
# Bosnian / Bosnisch (bs):
# sudo apt-get install $(check-language-support -l bs) -y
# Thai / Thailändisch (th):
# sudo apt-get install $(check-language-support -l th) -y
# Urdu (ur):
# sudo apt-get install $(check-language-support -l ur) -y
# russian / russisch (ru):
# sudo apt-get install $(check-language-support -l ru) -y

# refresh character set type cache 
sudo fc-cache -vf

# clean up / Aufräumen
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo apt-get clean -y
# end of software installation script
