2020-01-22 13:24:38 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-02-13 21:12:20 +01:00
|
|
|
# execute self with sudo if user is not root
|
|
|
|
[[ $UID -ne 0 ]] && exec sudo ./"$0"
|
|
|
|
|
2020-01-22 13:24:38 +01:00
|
|
|
###
|
|
|
|
# Set variables
|
|
|
|
###
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
DPKG_CFG_FRAGMENT=/etc/dpkg/dpkg.cfg.d/non-interactive
|
|
|
|
|
|
|
|
# Linux distro
|
|
|
|
script_distro='Linux Mint 19.x'
|
|
|
|
|
|
|
|
# Additional packages
|
|
|
|
packages=(
|
|
|
|
# Graphics
|
|
|
|
cheese
|
|
|
|
inkscape
|
2020-02-15 23:40:15 +01:00
|
|
|
pinta
|
2020-02-16 23:05:55 +01:00
|
|
|
gimp
|
2020-01-22 13:24:38 +01:00
|
|
|
|
|
|
|
# Office
|
|
|
|
libreoffice
|
|
|
|
|
|
|
|
# Security
|
|
|
|
keepassxc
|
|
|
|
|
|
|
|
# Games
|
|
|
|
0ad
|
|
|
|
beneath-a-steel-sky
|
|
|
|
billard-gl
|
|
|
|
blobby
|
|
|
|
blockout2
|
|
|
|
flight-of-the-amazon-queen
|
|
|
|
freeciv
|
|
|
|
frozen-bubble
|
|
|
|
gbrainy
|
|
|
|
gnome-games
|
|
|
|
gweled
|
|
|
|
hedgewars
|
|
|
|
lincity-ng
|
|
|
|
lure-of-the-temptress
|
|
|
|
openttd
|
|
|
|
pingus
|
|
|
|
pipewalker
|
|
|
|
pokerth
|
|
|
|
supertux
|
|
|
|
supertuxkart
|
|
|
|
teeworlds
|
|
|
|
wesnoth
|
|
|
|
widelands
|
|
|
|
|
|
|
|
# Gaming platforms
|
|
|
|
playonlinux
|
|
|
|
steam
|
|
|
|
wine-stable
|
|
|
|
winetricks
|
|
|
|
|
|
|
|
# System management
|
|
|
|
gparted
|
|
|
|
|
|
|
|
# Tools
|
|
|
|
hardinfo
|
|
|
|
shutter
|
|
|
|
vim
|
|
|
|
|
|
|
|
# Management
|
|
|
|
calibre
|
|
|
|
|
|
|
|
# Media
|
|
|
|
vlc
|
|
|
|
|
|
|
|
# Knowledge
|
|
|
|
goldendict
|
|
|
|
ubuntu-edu-preschool
|
|
|
|
ubuntu-edu-primary
|
|
|
|
ubuntu-edu-secondary
|
|
|
|
ubuntu-edu-tertiary
|
|
|
|
|
|
|
|
# Language support
|
|
|
|
language-selector-common
|
|
|
|
openoffice.org-hyphenation
|
|
|
|
language-pack-ar
|
|
|
|
language-pack-gnome-ar
|
|
|
|
language-pack-fa
|
|
|
|
language-pack-gnome-fa
|
|
|
|
)
|
|
|
|
|
|
|
|
###
|
|
|
|
# Functions
|
|
|
|
###
|
|
|
|
|
|
|
|
# $*: message to echo
|
|
|
|
e() {
|
2020-02-13 21:12:20 +01:00
|
|
|
printf "\e[31m>>>\e[0m %s\n" "$*"
|
2020-01-22 13:24:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# It's a pain to stop (ctrl+c, kill) execution with all the Python applications
|
|
|
|
# so we catch SIGINT and SIGTERM and exit immediately
|
|
|
|
handle_signal() {
|
|
|
|
e "Ausführung abgebrochen! Script wird beendet..."
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# always executed on shell exit regardless of reason. for cleanup tasks
|
|
|
|
handle_exit() {
|
2020-02-13 21:12:20 +01:00
|
|
|
e "Finales Cleanup wird durchgeführt..."
|
|
|
|
rm -f "$DPKG_CFG_FRAGMENT"
|
2020-01-22 13:24:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
trap handle_signal SIGINT SIGTERM
|
|
|
|
trap handle_exit EXIT
|
|
|
|
|
|
|
|
pkg() {
|
|
|
|
apt install "$@" --yes --quiet
|
|
|
|
}
|
|
|
|
|
|
|
|
###
|
|
|
|
# Greeting
|
|
|
|
###
|
|
|
|
echo "\
|
|
|
|
#####################################
|
|
|
|
# Computertruhe-Installationsskript #
|
|
|
|
#####################################
|
|
|
|
|
|
|
|
###
|
|
|
|
# Maintainer: Computertruhe e. V.
|
|
|
|
# Website: https://computertruhe.de/
|
|
|
|
# Version: 0.2.0
|
|
|
|
# Repo: https://codeberg.org/Computertruhe/computertruhe-setup
|
|
|
|
# Distro: ${script_distro}
|
|
|
|
###
|
|
|
|
"
|
|
|
|
e "Starte initiales Setup für Rechner mit frisch installiertem '${script_distro}' ..."
|
|
|
|
|
|
|
|
###
|
|
|
|
# Automatic installation
|
|
|
|
###
|
2020-02-13 21:12:20 +01:00
|
|
|
# place temporary dpkg configurations to ensure non-interactive upgrade
|
|
|
|
cat <<'DPKG' >"$DPKG_CFG_FRAGMENT"
|
|
|
|
force-confold
|
|
|
|
force-confdef
|
|
|
|
DPKG
|
|
|
|
|
|
|
|
e "Automatische Installation empfohlener Pakete aktivieren ..."
|
|
|
|
sed -i 's/false/true/g' /etc/apt/apt.conf.d/00recommends
|
|
|
|
|
|
|
|
e "Besten Spiegelserver für '${script_distro}' auswählen ..."
|
|
|
|
mint-switch-to-local-mirror
|
|
|
|
|
|
|
|
e "Paketquellen aktualisieren ..."
|
|
|
|
apt update --yes --quiet
|
|
|
|
|
|
|
|
e "System aktualisieren (apt) ..."
|
|
|
|
apt full-upgrade --yes --quiet
|
|
|
|
|
|
|
|
e "System aktualisieren (mintupdate-cli) ..."
|
|
|
|
mintupdate-cli --yes upgrade
|
|
|
|
|
|
|
|
e "Proprietäre Treiber installieren (sofern verfügbar) ..."
|
|
|
|
ubuntu-drivers autoinstall
|
|
|
|
|
|
|
|
e "Zusätzliche Software installieren ..."
|
|
|
|
pkg "${packages[@]}"
|
|
|
|
|
|
|
|
e "Sprachunterstützung vervollständigen ..."
|
|
|
|
pkg "$(check-language-support)"
|
|
|
|
# these packages have to be installed after "$(check-language-support)"
|
|
|
|
pkg hunspell-de-at hunspell-de-ch hunspell-de-de
|
|
|
|
|
|
|
|
e "Unnötige Pakete entfernen und Cache bereinigen ..."
|
|
|
|
apt clean --yes --quiet
|
|
|
|
apt autoremove --yes --quiet
|
|
|
|
|
|
|
|
# https://askubuntu.com/questions/1037553/how-to-configure-a-dconf-key-globally-across-all-user-accounts#1037557
|
|
|
|
# https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/desktop_migration_and_administration_guide/custom-default-values-system-settings
|
|
|
|
e "Tastatur- und Desktopoptionen werden angepasst"
|
|
|
|
mkdir -vp /etc/dconf/{profile,db/local.d}
|
|
|
|
|
|
|
|
cat <<'EOF' > /etc/dconf/profile/user
|
|
|
|
user-db:user
|
|
|
|
system-db:local
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cat <<'EOF' > /etc/dconf/db/local.d/00-keyboard-layout
|
|
|
|
[org/gnome/libgnomekbd/keyboard]
|
|
|
|
layouts=['de', 'ara', 'ir']
|
2020-01-22 13:24:38 +01:00
|
|
|
|
2020-02-13 21:12:20 +01:00
|
|
|
[org/cinnamon/desktop/interface]
|
|
|
|
keyboard-layout-show-flags=false
|
|
|
|
keyboard-layout-use-upper=true
|
|
|
|
keyboard-layout-prefer-variant-names=true
|
|
|
|
EOF
|
2020-01-22 13:24:38 +01:00
|
|
|
|
2020-02-13 21:12:20 +01:00
|
|
|
dconf update
|
2020-01-22 13:24:38 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# Finalisation
|
|
|
|
###
|
|
|
|
e "Initiales Setup beendet."
|