Optimized text

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-02 13:28:03 +02:00
parent 283abc9d8f
commit 48a9ed6440

View File

@ -16,76 +16,77 @@ FSTAB_SWAP_ENTRY="/swapfile none swap defaults 0 0"
SWAP_FILE="/swapfile" SWAP_FILE="/swapfile"
FSTAB_FILE="/etc/fstab" FSTAB_FILE="/etc/fstab"
if grep -q "$FSTAB_SWAP_ENTRY" "$FSTAB_FILE"; then if grep -q "$FSTAB_SWAP_ENTRY" "$FSTAB_FILE"; then
echo "Skipping creation of swap partion because entry allready exists in <<$FSTAB_FILE>>!" info "Skipping creation of swap partion because entry allready exists in \"$FSTAB_FILE\"!"
else else
echo "Creating swap partition..." info "Creating swap partition..."
sudo fallocate -l 16G "$SWAP_FILE" sudo fallocate -l 16G "$SWAP_FILE"
sudo chmod 600 "$SWAP_FILE" sudo chmod 600 "$SWAP_FILE"
sudo mkswap "$SWAP_FILE" sudo mkswap "$SWAP_FILE"
sudo swapon "$SWAP_FILE" sudo swapon "$SWAP_FILE"
sudo sh -c "echo \"$FSTAB_SWAP_ENTRY\">>\"$FSTAB_FILE\"" sudo sh -c "echo \"$FSTAB_SWAP_ENTRY\">>\"$FSTAB_FILE\""
fi fi
echo "Synchronizing programing language interpreters..." info "Synchronizing programing language interpreters..."
sudo pacman --needed -S jdk11-openjdk python php sudo pacman --needed -S jdk11-openjdk python php
echo "Synchronizing other interpreters..." info "Synchronizing other interpreters..."
sudo pacman --needed -S texlive-most sudo pacman --needed -S texlive-most
echo "Synchronizing compression tools..." info "Synchronizing compression tools..."
sudo pacman --needed -S p7zip sudo pacman --needed -S p7zip
echo "Synchronizing administration tools..." info "Synchronizing administration tools..."
sudo pacman --needed -S htop tree git base-devel yay make gcc cmake sudo pacman --needed -S htop tree git base-devel yay make gcc cmake
echo "Synchronizing network analyze tools..." info "Synchronizing network analyze tools..."
sudo pacman --needed -S traceroute wireshark-qt wireshark-cli sudo pacman --needed -S traceroute wireshark-qt wireshark-cli
echo "Synchronizing security tools..." info "Synchronizing security tools..."
sudo pacman --needed -S ecryptfs-utils encfs keepassxc sudo pacman --needed -S ecryptfs-utils encfs keepassxc
echo "Setup SSH key..." info "Setup SSH key..."
ssh_key_path="$HOME/.ssh/id_rsa" ssh_key_path="$HOME/.ssh/id_rsa"
if [ ! -f "$ssh_key_path" ]; then if [ ! -f "$ssh_key_path" ]; then
echo "->SSH key $ssh_key_path doesn't exists!" info "SSH key $ssh_key_path doesn't exists!"
if [ ! -f "./data$ssh_key_path" ]; then if [ ! -f "./data$ssh_key_path" ]; then
echo "->Importing ssh key from data..." info "Importing ssh key from data..."
bash ./scripts/export-data-to-system.sh bash ./scripts/export-data-to-system.sh
else else
echo "->Generating ssh key..." info "Generating ssh key..."
ssh-keygen -t rsa -b 4096 -C "$USER@$HOSTNAME" ssh-keygen -t rsa -b 4096 -C "$USER@$HOSTNAME"
fi fi
fi fi
if [[ "$(sudo lshw -C display)" == *"NVIDIA"* ]]; then if [[ "$(sudo lshw -C display)" == *"NVIDIA"* ]]; then
echo "Install NVIDIA drivers..." info "Install NVIDIA drivers..."
# Could be optimized
sudo mhwd -a pci nonfree 0300 sudo mhwd -a pci nonfree 0300
fi fi
echo "Synchronizing web tools..." info "Synchronizing web tools..."
sudo pacman --needed -S chromium firefox firefox-ublock-origin firefox-extension-https-everywhere firefox-dark-reader sudo pacman --needed -S chromium firefox firefox-ublock-origin firefox-extension-https-everywhere firefox-dark-reader
echo "Synchronizing office tools..." info "Synchronizing office tools..."
sudo pacman --needed -S ttf-liberation libreoffice-fresh \ sudo pacman --needed -S ttf-liberation libreoffice-fresh \
libreoffice-fresh-de libreoffice-fresh-eo libreoffice-fresh-es libreoffice-fresh-nl \ libreoffice-fresh-de libreoffice-fresh-eo libreoffice-fresh-es libreoffice-fresh-nl \
hunspell \ hunspell \
hunspell-de hunspell-es_es hunspell-en_US hunspell-nl hunspell-de hunspell-es_es hunspell-en_US hunspell-nl
echo "Synchronizing grafic tools..." info "Synchronizing grafic tools..."
sudo pacman --needed -S gimp blender sudo pacman --needed -S gimp blender
obs_requirements_memory_kb="4000000" obs_requirements_memory_kb="4000000"
if [ "$SYSTEM_MEMORY_KB" -gt "$obs_requirements_memory_kb" ]; then if [ "$SYSTEM_MEMORY_KB" -gt "$obs_requirements_memory_kb" ]; then
echo "Synchronizing obs studio..." info "Synchronizing obs studio..."
sudo pacman -S obs-studio sudo pacman -S obs-studio
fi fi
echo "Synchronizing communication tools..." info "Synchronizing communication tools..."
yay -S slack-desktop skypeforlinux-stable-bin yay -S slack-desktop skypeforlinux-stable-bin
sudo pacman -S base-devel git cmake pidgin libpurple mxml libxml2 sqlite libgcrypt #Optimize later sudo pacman -S base-devel git cmake pidgin libpurple mxml libxml2 sqlite libgcrypt #Optimize later
sudo pacman -Syyu pidgin sudo pacman -Syyu pidgin
yay -S libpurple-lurch libpurple-carbons yay -S libpurple-lurch libpurple-carbons
sudo pacman -Syyu purple-facebook sudo pacman -Syyu purple-facebook
echo "Synchronizing development tools..." info "Synchronizing development tools..."
echo "->Synchronizing code quality tools..." info "Synchronizing code quality tools..."
sudo pacman --needed -S shellcheck sudo pacman --needed -S shellcheck
echo "-Synchronizing language servers..." info "Synchronizing language servers..."
yay -S ccls yay -S ccls
echo "->Synchronizing visualization tools..." info "Synchronizing visualization tools..."
sudo pacman --needed -S dia sudo pacman --needed -S dia
echo "->Synchronizing IDE's..." info "Synchronizing IDE's..."
sudo pacman --needed -S eclipse-java atom arduino arduino-docs sudo pacman --needed -S eclipse-java atom arduino arduino-docs
echo "-->Add user to arduino relevant groups..." info "Add user to arduino relevant groups..."
sudo usermod -a -G uucp "$USER" || echo "Couldn't add <<$USER>> to group <<uucp>>. Try to add manually later!" sudo usermod -a -G uucp "$USER" || warning "Couldn't add \"$USER\" to group \"uucp\". Try to add manually later!"
sudo usermod -a -G lock "$USER" || echo "Couldn't add <<$USER>> to group <<lock>>. Try to add manually later!" sudo usermod -a -G lock "$USER" || warning "Couldn't add \"$USER\" to group \"lock\". Try to add manually later!"
echo "-->Installing atom packages..." info "Installing atom packages..."
apm install -c \ apm install -c \
atom-ide-ui\ atom-ide-ui\
ide-bash\ ide-bash\
@ -115,50 +116,50 @@ apm install -c \
docblockr docblockr
sudo npm i -g bash-language-server #Needed by atom-package ide-bash sudo npm i -g bash-language-server #Needed by atom-package ide-bash
python -m pip install 'python-language-server[all]' #Needed by atom python -m pip install 'python-language-server[all]' #Needed by atom
echo "->Synchronizing containerization tools..." info "Synchronizing containerization tools..."
echo "-->Installing docker..." info "Installing docker..."
sudo pacman --needed -S docker docker-compose sudo pacman --needed -S docker docker-compose
echo "-->Add current user<<$USER>> to user group docker..." info "Add current user \"$USER\" to user group docker..."
sudo usermod -a -G docker "$USER" sudo usermod -a -G docker "$USER"
echo "-->Enable docker service..." info "Enable docker service..."
sudo systemctl enable docker --now sudo systemctl enable docker --now
echo "->Synchronizing orchestration tools..." info "Synchronizing orchestration tools..."
sudo pacman --needed -S ansible sudo pacman --needed -S ansible
echo "->Synchronizing virtualisation tools..." info "Synchronizing virtualisation tools..."
pamac install virtualbox $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ') pamac install virtualbox $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-virtualbox-host-modules"}' ORS=' ')
sudo vboxreload sudo vboxreload
pamac build virtualbox-ext-oracle pamac build virtualbox-ext-oracle
sudo gpasswd -a "$USER" vboxusers sudo gpasswd -a "$USER" vboxusers
echo "Keep in mind to install the guest additions in the virtualized system. See https://wiki.manjaro.org/index.php?title=VirtualBox" info "Keep in mind to install the guest additions in the virtualized system. See https://wiki.manjaro.org/index.php?title=VirtualBox"
echo "Installing entertainment software..." info "Installing entertainment software..."
echo "->Synchronizing audio software..." info "Synchronizing audio software..."
sudo pacman -S rhythmbox sudo pacman -S rhythmbox
minimum_gaming_memory_kb="4000000" minimum_gaming_memory_kb="4000000"
if [ "$SYSTEM_MEMORY_KB" -gt "$minimum_gaming_memory_kb" ]; then if [ "$SYSTEM_MEMORY_KB" -gt "$minimum_gaming_memory_kb" ]; then
echo "->Synchronizing games..." info "Synchronizing games..."
sudo pacman --needed -S 0ad warzone2100 sudo pacman --needed -S 0ad warzone2100
echo "->Synchronizing emulationstation..." info "Synchronizing emulationstation..."
yay -S emulationstation #retroarch joyutils jstest-gtk-git 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 yay -S libretro-snes9x-next-git libretro-quicknes-git libretro-fceumm-git libretro-prosystem-git libretro-gambatte-git libretro-mgba-git
echo "-->Installing themes..." info "Installing themes..."
mkdir .emulationstation/themes mkdir .emulationstation/themes
git clone https://github.com/RetroPie/es-theme-carbon .emulationstation/themes/carbon git clone https://github.com/RetroPie/es-theme-carbon .emulationstation/themes/carbon
echo "More game recomendations you will find here: https://wiki.archlinux.org/index.php/List_of_games..." info "More game recomendations you will find here: https://wiki.archlinux.org/index.php/List_of_games..."
fi fi
if [ "$XDG_SESSION_TYPE" == "x11" ]; then if [ "$XDG_SESSION_TYPE" == "x11" ]; then
echo "->Synchronizing xserver tools..." info "Synchronizing xserver tools..."
sudo pacman --needed -S xbindkeys sudo pacman --needed -S xbindkeys
echo "-->Setting up key bindings..." info "Setting up key bindings..."
echo "" >> "$HOME/.xbindkeysrc" echo "" >> "$HOME/.xbindkeysrc"
echo "\"gnome-terminal -e '/bin/bash $SCRIPT_PATH/import-data-from-system.sh'\"" >> "$HOME/.xbindkeysrc" echo "\"gnome-terminal -e '/bin/bash $SCRIPT_PATH/import-data-from-system.sh'\"" >> "$HOME/.xbindkeysrc"
echo " control+alt+s" >> "$HOME/.xbindkeysrc" echo " control+alt+s" >> "$HOME/.xbindkeysrc"
xbindkeys --poll-rc xbindkeys --poll-rc
fi fi
if [ "$DESKTOP_SESSION" == "gnome" ]; then if [ "$DESKTOP_SESSION" == "gnome" ]; then
echo "->Synchronizing gnome tools..." info "Synchronizing gnome tools..."
sudo pacman --needed -S gnome-shell-extensions gnome-terminal sudo pacman --needed -S gnome-shell-extensions gnome-terminal
echo "-->Setting up gnome specific software..." info "Setting up gnome specific software..."
echo "-->Setting up dash favourites..." info "Setting up dash favourites..."
gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop', gsettings set org.gnome.shell favorite-apps "['org.gnome.Nautilus.desktop',
'org.gnome.Terminal.desktop', 'org.gnome.Terminal.desktop',
'org.keepassxc.KeePassXC.desktop', 'org.keepassxc.KeePassXC.desktop',
@ -172,19 +173,19 @@ if [ "$DESKTOP_SESSION" == "gnome" ]; then
'blender.desktop', 'blender.desktop',
'rhythmbox.desktop', 'rhythmbox.desktop',
'org.gnome.Screenshot.desktop']" 'org.gnome.Screenshot.desktop']"
echo "-->Install GNOME extensions..." info "Install GNOME extensions..."
echo "--->Install <<NASA picture of the day>>..." info "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" git clone https://github.com/Elinvention/gnome-shell-extension-nasa-apod.git "$HOME/.local/share/gnome-shell/extensions/nasa_apod@elinvention.ovh"
gnome-extensions enable nasa_apod@elinvention.ovh gnome-extensions enable nasa_apod@elinvention.ovh
echo "--->Install <<Open Weather>>..." info "Install \"Open Weather\"..."
git clone https://gitlab.com/jenslody/gnome-shell-extension-openweather "$HOME/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de" git clone https://gitlab.com/jenslody/gnome-shell-extension-openweather "$HOME/.local/share/gnome-shell/extensions/openweather-extension@jenslody.de"
gnome-extensions enable openweather-extension@jenslody.de gnome-extensions enable openweather-extension@jenslody.de
echo "--->Install <<Dash to Panel>>..." info "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" 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"
gnome-extensions enable dash-to-panel@jderose9.github.com gnome-extensions enable dash-to-panel@jderose9.github.com
echo "--->Deaktivating <<Dash to Dock>>" info "Deaktivating \"Dash to Dock\""
gnome-extensions disable dash-to-dock@micxgx.gmail.com gnome-extensions disable dash-to-dock@micxgx.gmail.com
fi fi
echo "Removing all software from user startup..." info "Removing all software from user startup..."
rm ~/.config/autostart/* rm ~/.config/autostart/*
echo "More software recomendations you will find here: https://wiki.archlinux.org/index.php/list_of_applications" info "More software recomendations you will find here: https://wiki.archlinux.org/index.php/list_of_applications"