#!/bin/bash # First argument is the link to the deb file to download function download_install_deb() { wget -O /tmp/installer.deb "$1" dpkg -i /tmp/installer.deb || apt install -f -y rm /tmp/installer.deb } ( set -e if [ "$EUID" -ne 0 ]; then echo "Please run with sudo command." echo "NOTICE: DO NOT RUN THIS IN LOG IN SHELL WHEN LOGGING IN AS ROOT!" echo "YOUR \`logname\` OUTPUT MUST BE THE DESIRED USER PROGRAMS SHOULD BE INSTALLED FOR" false fi USERNAME=$(logname) # MACROS APT_INSTALL="apt install -y" APT_INSTALL_SUGGESTS="apt install --install-suggests -y" APT_AUTOPURGE="apt autoremove --purge -y" USERAPPDIR="/home/$USERNAME/.userapps" USERBINDIR="/home/$USERNAME/.local/bin" # Creating directories in home to host custom applications and commands mkdir -p "$USERAPPDIR" mkdir -p "$USERBINDIR" # Updating repositories before starting apt update # Removing snap and installing gnome-software without snap support # (exactly in this order, do not change) $APT_AUTOPURGE snapd $APT_INSTALL_SUGGESTS gnome-software $APT_AUTOPURGE gnome-software-plugin-snap snapd # Remove thunderbird, I just like evolution better $APT_AUTOPURGE thunderbird # Install some programs and utilities (NO SUGGESTIONS) $APT_INSTALL htop mesa-utils mlocate tree build-essential git gnome-tweak-tool \ hwloc cpufrequtils stress gparted gnuplot grub-customizer module-assistant \ apt-file linux-headers-generic manpages-posix manpages-posix-dev colordiff \ valgrind curl vlc chrome-gnome-shell screen xclip # Install some programs and utilities (SUGGESTIONS INCLUDED) $APT_INSTALL_SUGGESTS evolution p7zip-full cmake gimp audacity peek # Install Telegram Desktop wget -O /tmp/telegram-desktop.tar.xz https://telegram.org/dl/desktop/linux tar -xf /tmp/telegram-desktop.tar.xz --directory "$USERAPPDIR" ln -fs "$USERAPPDIR/Telegram/Telegram" "$USERBINDIR/telegram" # Otherwise Telegram is recognized automatically in the next reboot echo "" echo "Telegram Desktop installed as \`$USERBINDIR/telegram\`, to create corresponding desktop file run \`telegram\`" echo "NOTICE: until your next logout/login there could be some problems if \`$USERBINDIR\` did not exist before running this utility!" echo "" # In order: Discord, Google Chrome, VSCode, Skype For Linux download_install_deb "https://discordapp.com/api/download?platform=linux" download_install_deb "https://go.microsoft.com/fwlink/?LinkID=760868" download_install_deb "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" download_install_deb "https://go.skype.com/skypeforlinux-64.deb" # Installing Spotify # NOTICE: requires curl for some reason! # TODO: test if using the following commented line works too when run as root # wget -nv -O- "https://download.spotify.com/debian/pubkey.gpg" | apt-key add - curl -sS "https://download.spotify.com/debian/pubkey.gpg" | apt-key add - echo "deb http://repository.spotify.com stable non-free" | tee /etc/apt/sources.list.d/spotify.list # Get Spotify repo info apt update $APT_INSTALL spotify-client # Use this only if you have a high-resolution screen (works only after logout/login) cat >"$USERBINDIR/spotify" <