linux-image-manager/scripts/system-setup.sh

164 lines
6.6 KiB
Bash
Raw Normal View History

2019-09-30 13:44:02 +02:00
#!/bin/bash
2019-10-01 11:59:31 +02:00
#
2019-10-01 08:50:17 +02:00
# Installs the core system
# @author Kevin Veen-Birkenbach [aka. Frantz]
2019-10-01 12:30:27 +02:00
#
# shellcheck source=/dev/null # Deactivate SC1090
source "$(dirname "$(readlink -f "${0}")")/base.sh"
echo "Start setup of customized core software..."
2019-10-07 10:44:59 +02:00
echo "Copying templates to home folder..."
2019-10-07 12:20:57 +02:00
cp -rfv "$TEMPLATE_PATH/." "$HOME"
2019-09-30 13:44:02 +02:00
echo "Synchronising packages..."
2019-10-23 22:26:39 +02:00
sudo pacman -Syyu
FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
SWAP_FILE="/swapfile"
FSTAB_FILE="/etc/fstab"
if grep -q "$FSTAB_SWAP_ENTRY" "$FSTAB_FILE"; then
echo "Skipping creation of swap partion because entry allready exists in <<$FSTAB_FILE>>!"
else
echo "Creating swap partition..."
sudo fallocate -l 16G "$SWAP_FILE"
sudo chmod 600 "$SWAP_FILE"
sudo mkswap "$SWAP_FILE"
sudo swapon "$SWAP_FILE"
2019-11-01 19:12:45 +01:00
sudo sh -c "echo \"$FSTAB_SWAP_ENTRY\">>\"$FSTAB_FILE\""
fi
2019-10-03 20:32:52 +02:00
echo "Synchronizing programing language interpreters..."
2019-09-30 13:44:02 +02:00
sudo pacman --needed -S jdk11-openjdk python php
2019-11-29 21:11:26 +01:00
echo "Synchronizing other interpreters..."
sudo pacman --needed -S texlive-most
2019-10-04 11:49:05 +02:00
echo "Synchronizing compression tools..."
sudo pacman --needed -S p7zip
2019-09-30 13:44:02 +02:00
echo "Synchronizing administration tools..."
sudo pacman --needed -S htop tree git base-devel yay make gcc cmake
2019-11-22 11:49:52 +01:00
echo "Synchronizing network analyze tools..."
sudo pacman --needed -S traceroute wireshark-qt wireshark-cli
echo "Synchronizing security tools..."
sudo pacman --needed -S ecryptfs-utils encfs keepassxc
2019-10-07 08:58:21 +02:00
echo "Setup SSH key..."
2019-09-30 16:13:26 +02:00
ssh_key_path="$HOME/.ssh/id_rsa"
if [ ! -f "$ssh_key_path" ]; then
2019-10-07 08:58:21 +02:00
echo "->SSH key $ssh_key_path doesn't exists!"
2019-09-30 16:13:26 +02:00
if [ ! -f "./data$ssh_key_path" ]; then
2019-10-07 08:58:21 +02:00
echo "->Importing ssh key from data..."
2019-09-30 16:13:26 +02:00
bash ./scripts/export-data-to-system.sh
else
2019-10-07 08:58:21 +02:00
echo "->Generating ssh key..."
2019-09-30 16:13:26 +02:00
ssh-keygen -t rsa -b 4096 -C "$USER@$HOSTNAME"
fi
fi
if [[ "$(sudo lshw -C display)" == *"NVIDIA"* ]]; then
echo "Install NVIDIA drivers..."
sudo mhwd -a pci nonfree 0300
fi
2019-09-30 23:51:06 +02:00
echo "Synchronizing web tools..."
sudo pacman --needed -S chromium firefox firefox-ublock-origin firefox-extension-https-everywhere firefox-dark-reader
2019-09-30 13:44:02 +02:00
echo "Synchronizing office tools..."
2019-10-01 11:59:31 +02:00
sudo pacman --needed -S ttf-liberation libreoffice-fresh \
libreoffice-fresh-de libreoffice-fresh-eo libreoffice-fresh-es libreoffice-fresh-nl \
hunspell \
hunspell-de hunspell-es_es hunspell-en_US hunspell-nl
echo "Synchronizing grafic tools..."
2019-10-15 21:42:12 +02:00
sudo pacman --needed -S gimp blender
2019-09-30 13:44:02 +02:00
echo "Synchronizing communication tools..."
2019-10-01 17:02:40 +02:00
yay -S slack-desktop skypeforlinux-stable-bin
2019-09-30 13:44:02 +02:00
echo "Synchronizing development tools..."
2019-10-03 20:32:52 +02:00
echo "->Synchronizing code quality tools..."
2019-10-01 07:55:33 +02:00
sudo pacman --needed -S shellcheck
2019-10-03 22:18:44 +02:00
echo "-Synchronizing language servers..."
yay -S ccls
2019-10-03 20:32:52 +02:00
echo "->Synchronizing visualization tools..."
2019-09-30 13:44:02 +02:00
sudo pacman --needed -S dia
2019-10-03 20:32:52 +02:00
echo "->Synchronizing IDE's..."
2019-10-05 20:16:30 +02:00
sudo pacman --needed -S eclipse-java atom arduino arduino-docs
echo "-->Add user to arduino relevant groups..."
2019-10-23 22:26:39 +02:00
usermod -a -G uucp "$USER" || echo "Couldn't add <<$USER>> to group <<uucp>>. Try to add manually later!"
usermod -a -G lock "$USER" || echo "Couldn't add <<$USER>> to group <<lock>>. Try to add manually later!"
2019-10-03 20:32:52 +02:00
echo "-->Installing atom packages..."
2019-09-30 13:44:02 +02:00
apm install -c \
atom-ide-ui\
ide-bash\
ide-python\
ide-c-cpp\
ide-java\
ide-yaml\
atom-autocomplete-php\
es6-snippets\
javascript-snippets\
emmet\
git-blame\
git-plus\
script\
ask-stack\
atom-beautify\
highlight-selected\
autocomplete-paths\
todo-show\
2019-11-29 21:26:15 +01:00
linter-spell\
language-latex\
2019-11-29 21:23:30 +01:00
linter-spell-latex\
2019-10-01 08:50:17 +02:00
docblockr
2019-10-23 22:26:39 +02:00
sudo npm i -g bash-language-server #Needed by atom-package ide-bash
2019-12-09 11:12:37 +01:00
python -m pip install 'python-language-server[all]' #Needed by atom
2019-10-03 20:32:52 +02:00
echo "->Synchronizing containerization tools..."
echo "-->Installing docker..."
2019-10-04 11:49:05 +02:00
sudo pacman --needed -S docker docker-compose
echo "-->Add current user<<$USER>> to user group docker..."
2019-10-01 07:55:33 +02:00
sudo usermod -a -G docker "$USER"
2019-10-03 20:32:52 +02:00
echo "-->Enable docker service..."
2019-09-30 14:47:48 +02:00
sudo systemctl enable docker --now
2019-10-03 20:32:52 +02:00
echo "->Synchronizing orchestration tools..."
2019-10-01 08:03:57 +02:00
sudo pacman --needed -S ansible
2019-11-02 11:26:37 +01:00
echo "->Synchronizing virtualisation tools..."
pamac install virtualbox $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ')
sudo vboxreload
pamac build virtualbox-ext-oracle
2019-11-22 11:53:23 +01:00
sudo gpasswd -a "$USER" vboxusers
2019-11-02 11:26:37 +01:00
echo "Keep in mind to install the guest additions in the virtualized system. See https://wiki.manjaro.org/index.php?title=VirtualBox"
2019-10-03 20:32:52 +02:00
echo "Installing entertainment software..."
echo "->Synchronizing audio software..."
2019-10-03 22:18:44 +02:00
sudo pacman -S rhythmbox
2019-10-03 20:32:52 +02:00
echo "->Synchronizing games..."
2019-09-30 13:44:02 +02:00
sudo pacman --needed -S 0ad warzone2100
2019-10-03 20:32:52 +02:00
echo "->Synchronizing emulationstation..."
2019-10-02 16:41:44 +02:00
yay -S emulationstation #retroarch joyutils jstest-gtk-git
yay -S libretro-snes9x-next-git libretro-quicknes-git libretro-fceumm-git libretro-prosystem-git libretro-gambatte-git libretro-mgba-git
2019-10-03 20:32:52 +02:00
echo "-->Installing themes..."
2019-10-02 16:41:44 +02:00
mkdir .emulationstation/themes
git clone https://github.com/RetroPie/es-theme-carbon .emulationstation/themes/carbon
2019-09-30 13:44:02 +02:00
echo "More game recomendations you will find here: https://wiki.archlinux.org/index.php/List_of_games..."
echo "Synchronizing gui tools..."
sudo pacman --needed -S gnome-shell-extensions gnome-terminal xbindkeys
echo "->Setting up key bindings..."
echo "" >> "$HOME/.xbindkeysrc"
echo "\"gnome-terminal -e '/bin/bash $SCRIPT_PATH/import-data-from-system.sh'\"" >> "$HOME/.xbindkeysrc"
echo " control+alt+s" >> "$HOME/.xbindkeysrc"
xbindkeys --poll-rc
echo "->Setting up dash favourites..."
gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop',
'org.gnome.Terminal.desktop',
'org.keepassxc.KeePassXC.desktop',
'firefox.desktop',
'chromium.desktop',
'atom.desktop',
'arduino.desktop',
'eclipse.desktop',
'vlc.desktop',
'gimp.desktop',
'blender.desktop',
2019-10-30 11:48:59 +01:00
'rhythmbox.desktop',
'org.gnome.Screenshot.desktop']"
echo "->Install GNOME extensions..."
echo "-->Install <<NASA picture of the day>>..."
git clone https://github.com/Elinvention/gnome-shell-extension-nasa-apod.git "$HOME/.local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh"
2019-10-24 20:33:25 +02:00
gnome-extensions enable nasa_apod@elinvention.ovh
echo "-->Install <<Open Weather>>..."
git clone https://gitlab.com/jenslody/gnome-shell-extension-openweather "$HOME/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de"
2019-10-24 20:33:25 +02:00
gnome-extensions enable openweather-extension@jenslody.de
echo "-->Install <<Dash to Panel>>..."
git clone https://github.com/home-sweet-gnome/dash-to-panel "$HOME/.local/share/gnome-shell/extensions/openweather-extension@dash-to-panel@jderose9.github.com"
2019-10-24 20:33:25 +02:00
gnome-extensions enable dash-to-panel@jderose9.github.com
echo "Deaktivating <<Dash to Dock>>"
gnome-extensions disable dash-to-dock@micxgx.gmail.com
2019-09-30 13:44:02 +02:00
echo "More software recomendations you will find here: https://wiki.archlinux.org/index.php/list_of_applications"