Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 94 additions & 74 deletions lazy-script.sh
Original file line number Diff line number Diff line change
@@ -1,125 +1,145 @@
#!/bin/bash

# set exit on error
set -e

# check if root
if [[ $EUID -ne 0 ]]; then
echo -e "error: you must be a root user to run this script. \nplease run 'sudo $0'" >&2
exit 1
fi
[[ $EUID -ne 0 ]] && { echo -e "error: you must be a root user to run this script. \nplease run 'sudo $0'"; exit 1; }

# update system packages
apt update && apt upgrade -y

# disable snapd services
systemctl disable snapd.service
systemctl disable snapd.socket
systemctl disable snapd.seeded.service
# set target user for application specific permissions
TARGET_USER=$(ls /home/)

# remove snap packages
snap list | awk '{print $1}' > ./snap-packages.txt
tac ./snap-packages.txt | xargs snap remove

# remove snapd files and directories
rm -rf /var/cache/snapd/
apt autoremove --purge snapd
rm -rf ~/snap ./snap-packages.txt
# update system packages
apt update && apt upgrade -fy

# update system packages
apt update && apt upgrade -y
apt update && apt upgrade -fy

# install media codecs
apt install ubuntu-restricted-extras -y
apt install ubuntu-restricted-extras -fy

# install cli tools and applications
apt install wget git curl emacs nano vim neovim unzip -y
apt install wget git curl emacs nano vim neovim unzip -fy

# install common dev-tools and dependencies
apt install apt-transport-https build-essential ca-certificates gnupg gnupg-agent gcc g++ cmake lsb-release nodejs npm software-properties-common python3 apache2 nginx -y
apt install apt-transport-https build-essential ca-certificates fonts-font-awesome gnupg gnupg-agent gcc g++ cmake libsecret-1-dev lsb-release nodejs npm software-properties-common python3 apache2 nginx -fy

# install more cli tools and applications
apt install bat cmatrix exa figlet fortune-mod lolcat neofetch parallel speedtest-cli trash-cli -y

# download deb-packages for some common applications
apt install bat cmatrix exa figlet fortune-mod lolcat neofetch parallel speedtest-cli trash-cli -fy

# declate deb-packages
declare -a deb_packages=(
'code - https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64'
'cloudflared - https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb'
'google-chrome - https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
'git-delta - https://github.com/dandavison/delta/releases/download/0.8.3/git-delta_0.8.3_amd64.deb'
'hyper-term - https://releases.hyper.is/download/deb'
'mailspring - https://updates.getmailspring.com/download?platform=linuxDeb'
'slack - https://downloads.slack-edge.com/releases/linux/4.35.126/prod/x64/slack-desktop-4.35.126-amd64.deb'
)

# create deb-packages directory
mkdir -p deb-packages/ && cd deb-packages/
wget 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -O code.deb
wget 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' -O google-chrome.deb
wget 'https://github.com/dandavison/delta/releases/download/0.8.3/git-delta_0.8.3_amd64.deb' -O git-delta.deb
wget 'https://releases.hyper.is/download/deb' -O hyper-term.deb
wget 'https://updates.getmailspring.com/download?platform=linuxDeb' -O mailspring.deb
wget 'https://downloads.slack-edge.com/linux_releases/slack-desktop-4.20.0-amd64.deb' -O slack.deb

# install downloaded deb-packages
dpkg -i code.deb google-chrome.deb git-delta.deb hyper-term.deb mailspring.deb slack.deb -y
# download and install deb-packages
for pkg in "${deb_packages[@]}"; do read -r name _ url <<< "$pkg"; wget -O "$name.deb" "$url"; done
dpkg -i *.deb
apt install -fy

# remove downloaded deb-packages
# clean up deb-packages directory
cd ../ && rm -rf ./deb-packages

# download zip files for some more applications
# decalre zip-files
declare -a zip_files=(
'aws-cli - https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip'
)

# create zip-files directory
mkdir -p zips && cd zips/
wget 'https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip' -O aws-cli.zip

# unzip and install downloaded zips
unzip aws-cli.zip
# download and install zip-files
for file in "${zip_files[@]}"; do read -r name _ url <<< "$file"; wget -O "$name.zip" "$url"; done
unzip *.zip
bash ./aws/install

# remove downloaded zips
# clean up zip-files directory
cd ../ && rm -rf ./zips

# add common repositories and keyrings
# add repositories and keyrings
apt-add-repository ppa:ansible/ansible
mkdir -p /etc/apt/keyrings
curl -fsSL 'https://pkg.cloudflare.com/cloudflare-main.gpg' | tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/cloudflare-main.gpg] 'https://pkg.cloudflare.com/cloudflared' $(lsb_release -cs)" | tee /etc/apt/sources.list.d/cloudflared.list > /dev/null
curl -fsSL 'https://download.docker.com/linux/ubuntu/gpg' | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] 'https://download.docker.com/linux/ubuntu' $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null

# update system packages
apt update && apt upgrade -y

# install more dev-tools from added repositories
apt install ansible cloudflared docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
# update system packages and install additional dev-tools
apt update && apt upgrade -fy
apt install ansible docker-ce docker-ce-cli containerd.io docker-compose-plugin -fy

# add user group for docker
groupadd docker
usermod -aG docker $USER
grep -q '^docker:' /etc/group || groupadd docker
# usermod -aG docker $USER
usermod -aG docker $TARGET_USER

# install nvm
curl 'https://raw.githubusercontent.com/creationix/nvm/master/install.sh' | bash
curl 'https://raw.githubusercontent.com/creationix/nvm/master/install.sh' | sudo -u $TARGET_USER bash

# install common gnome-tools
apt install gnome-tweaks gnome-shell-extension-manager chrome-gnome-shell -y
apt install --install-suggests gnome-software -y && flatpak remote-add --if-not-exists flathub 'https://flathub.org/repo/flathub.flatpakrepo'

# install gnome-extensions
gnome-extensions enable user-theme@gnome-shell-extensions.gcampax.github.com
gnome-extensions enable Hide_Activities@shay.shayel.org
gnome-extensions enable openweather-extension@jenslody.de
gnome-extensions enable search-light@icedman.github.com
gnome-extensions enable rocketbar@chepkun.github.com
gnome-extensions enable openweather-extension@jenslody.d
gnome-extensions enable clipboard-history@alexsaveau.dev
gnome-extensions enable burn-my-windows@schneegans.github.com

# download theme -- nord
apt install gnome-tweaks gnome-shell-extension-manager chrome-gnome-shell -fy
apt install --install-suggests gnome-software -fy && flatpak remote-add --if-not-exists flathub 'https://flathub.org/repo/flathub.flatpakrepo'

# create list of snap packages
snap_packages=$(snap list | awk '$1 != "Name" && $1 != "snapd" {print $1}' | tac)
snap_packages+=" snapd"

# remove snap packages
for pkg in $snap_packages; do snap remove "$pkg"; done

# disable snapd services
systemctl disable snapd.service snapd.socket snapd.seeded.service

# remove snapd files and directories
rm -rf /var/cache/snapd/
apt autoremove --purge snapd
rm -rf ~/snap

# declare gnome-extensions
declare -a gnome_extensions=(
'user-theme@gnome-shell-extensions.gcampax.github.com'
'Hide_Activities@shay.shayel.org'
'openweather-extension@jenslody.de'
'search-light@icedman.github.com'
'rocketbar@chepkun.github.com'
'openweather-extension@jenslody.d'
'clipboard-history@alexsaveau.dev'
'burn-my-windows@schneegans.github.com'
)

# install and enable gnome-extensions -- temp workaround cause couldn't figure out cli download and install
for extension in "${gnome_extensions[@]}"; do echo "$extension" >> "/home/$TARGET_USER/extentions.txt"; done

# download and install theme -- nord
git clone 'https://github.com/EliverLara/Nordic.git' /usr/share/themes/nordify

# install cursor -- nordzy
# download and install cursor -- nordzy
git clone 'https://github.com/alvatip/Nordzy-cursors' nordzy-cursors
bash ./nordzy-cursors/install.sh

# download fonts
apt install fonts-font-awesome
wget 'https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip' -O fira-code.zip
wget 'https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip' -O meslo.zip
wget 'https://github.com/todylu/monaco.ttf/raw/master/monaco.ttf' -O Monaco.ttf
# declare fonts
declare -a fonts=(
'fira-code.zip - https://github.com/ryanoasis/nerd-fonts/releases/latest/download/FiraCode.zip'
'meslo.zip - https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.zip'
'Monaco.ttf - https://github.com/todylu/monaco.ttf/raw/master/monaco.ttf'
)

# install fonts
# download and install fonts
for font in "${fonts[@]}"; do read -r name _ url <<< "$font"; wget -O "$name" "$url"; done
unzip meslo.zip -d /usr/share/fonts && unzip fira-code.zip -d /usr/share/fonts
mv Monaco.ttf /usr/share/fonts

# update font cache
fc-cache -vf

# remove unwanted files and directories
# clean up font files and cursors directory
rm -rf fira-code.zip meslo.zip nordzy-cursors

# print banger message on completion
Expand Down