5
0
Fork 0
mirror of https://codeberg.org/Computertruhe/Setup-Skripte.git synced 2024-06-06 18:46:25 +02:00
Computertruhe-Setup-Skripte.../linux_mint.sh
Matthias Lisin 0ed806753b Rename more_packages to packages.
Move some language packages to packages list.
Revert apt-get to apt.
Add info about install order
2020-01-11 01:01:10 +01:00

190 lines
3.8 KiB
Bash
Executable file

#!/usr/bin/env bash
###
# Set variables
###
export DEBIAN_FRONTEND=noninteractive
# Color of prefix (>>>) to distinguish user and root echos
color_prefix=32 # green
# Linux distro
script_distro='Linux Mint 19.x'
# Additional packages
packages=(
# Graphics
cheese
inkscape
# 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
# 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
###
is_root() {
[[ $UID -eq 0 ]]
}
# $*: message to echo
e() {
printf "\e[%sm>>>\e[0m %s\n" "$color_prefix" "$*"
}
# 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
}
trap handle_signal SIGINT SIGTERM
pkg() {
apt install "$@" --quiet --yes
}
###
# Root setup
###
if is_root; then
color_prefix=31 # red
if [[ $1 != "root-setup" ]]; then
e "Dieses Script sollte nicht direkt als Root ausgeführt werden!" >&2
e "Privilegien werden automatisch eskaliert sobald es notwendig ist." >&2
exit 1
fi
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
e "Root Setup abgeschlossen."
# It's very important to exit here. We don't want root past this point!
exit
fi
###
# 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
###
e "Script wird als Root ausgeführt für privilegierte Aufgaben"
sudo ./"$0" root-setup
e "Richte arabisches und persisches Tastatur-Layout ein..."
gsettings set org.gnome.libgnomekbd.keyboard layouts "['de', 'ara', 'ir']"
e "Ändere Anzeigeoptionen für die Tastatur auf die richtigen Werte..."
gsettings set org.cinnamon.desktop.interface keyboard-layout-show-flags false
gsettings set org.cinnamon.desktop.interface keyboard-layout-use-upper true
gsettings set org.cinnamon.desktop.interface keyboard-layout-prefer-variant-names true
###
# Finalisation
###
e "Initiales Setup beendet."