Skip to content

Instantly share code, notes, and snippets.

@whinee
Last active December 29, 2023 07:59
Show Gist options
  • Save whinee/23d21480e1f56a50bedcd32eb3d10e2e to your computer and use it in GitHub Desktop.
Save whinee/23d21480e1f56a50bedcd32eb3d10e2e to your computer and use it in GitHub Desktop.
This gist exists as I reinstall Arch Linux every so often, and I want an easy way to install applications and set configurations

whinestall

This gist exists as I reinstall Arch Linux every so often, and I want an easy way to install applications and set configurations.

This install script almost do not need user interactions except for other programs that do not have an option to not prompt the user.

Needed to be run at root account.

Tested on Arch Linux 5.14.11-arch1-1.

Installs:

  • base-devel
  • BetterDiscord
  • caprine
  • discord_arch_electron
  • discord-canary-electron-bin
  • discord-ptb
  • flameshot
  • flatpak
  • fuse
  • gcolor3
  • git
  • gnome-keyring
  • insomnia
  • moreutils
  • nano
  • noto-fonts-emoji
  • npm
  • obs-studio
  • package query
  • pamac-aur
  • python 3.10
  • rust
  • scrcpy
  • snap
  • spectacle
  • spotify
  • squashfuse
  • sublime-text
  • telegram-desktop
  • visual-studio-code-bin
  • vivaldi
  • vivaldi-ffmpeg-codecs
  • wget
  • yajl
  • yaourt
  • yay

Creates:

  • Swapfile (15G)

Setups:

  • Adblocking for spotify (doesn't work anymore :( )
  • DNS (1.1.1.1 and 1.0.0.1)
# Set permissions (use the following if you are executing this in non-root account)
# chown -R "$USER:" /etc/fstab
# chown -R "$USER:" /etc/pacman.conf
# chown -R "$USER:" /tmp/
# chown -R "$USER:" /usr/share/applications/
# chown -R "$USER:" /usr/share/pixmaps/
# Setup DNS
touch /etc/resolvconf.conf
chown -R "$USER:" /etc/resolvconf.conf
echo "\nnameserver 1.1.1.1\nnameserver 1.0.0.1" | tee -a /etc/resolvconf.conf
# Install thru Pacman
pacman -Syyu --noconfirm moreutils
echo "\nParallelDownloads = 10" | tee -a /etc/pacman.conf
## Setup gpg and server for installing ssublime text
curl -O https://download.sublimetext.com/sublimehq-pub.gpg && pacman-key --add sublimehq-pub.gpg && pacman-key --lsign-key 8A8F901A && rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | tee -a /etc/pacman.conf
pacman -Syyu base-devel caprine flameshot flatpak fuse gcolor3 git gnome-keyring moreutils nano noto-fonts-emoji npm obs-studio rust spectacle squashfuse sublime-text vivaldi vivaldi-ffmpeg-codecs wget yajl
# Install fonts
touch /etc/fonts/local.conf
chown -R "$USER:" /etc/fonts/local.conf
echo '<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd"><fontconfig><alias><family>sans-serif</family><prefer><family>Noto Sans</family><family>Noto Color Emoji</family><family>Noto Emoji</family><family>DejaVu Sans</family></prefer></alias><alias><family>serif</family><prefer><family>Noto Serif</family><family>Noto Color Emoji</family><family>Noto Emoji</family><family>DejaVu Serif</family></prefer></alias><alias><family>monospace</family><prefer><family>Noto Mono</family><family>Noto Color Emoji</family><family>Noto Emoji</family><family>DejaVu Sans Mono</family></prefer></alias></fontconfig>' | tee -a /etc/fonts/local.conf
fc-cache
# Swapfile
dd if=/dev/zero of=/swapfile bs=1G count=15 status=progress
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo -e '\n/swapfile none swap defaults 0 0' | tee -a /etc/fstab
# Install thru Source
cd /tmp/
## Install package query
git clone https://aur.archlinux.org/package-query.git
cd package-query/
makepkg -si --noconfirm
cd .. && rm -rf package-query
## Install python
mkdir python/
wget -O python.tgz https://www.python.org/ftp/python/3.10.0/Python-3.10.0rc1.tgz
tar xzf python.tgz --directory python --strip-components 1
cd python/
./configure
make
make install
cd .. && rm -rf python.tgz python/
## Install snap
git clone https://aur.archlinux.org/snapd.git
cd snapd
makepkg -si --noconfirm
systemctl enable --now snapd.socket
ln -s /var/lib/snapd/snap /snap
modprobe loop
cd .. && rm -rf snapd
## Install yaourt
git clone https://aur.archlinux.org/yaourt.git
cd yaourt/
makepkg -si --noconfirm
echo -e "NOCONFIRM=1\nBUILD_NOCONFIRM=1\nEDITFILES=0" | tee -a ~/.yaourtrc
cd .. && rm -rf yaourt/
## Install thru Yaourt
yes | yaourt -S discord_arch_electron discord-canary-electron-bin discord-ptb insomnia pamac-aur scrcpy telegram-desktop visual-studio-code-bin
## Install npm
### note: this piece of shit is the reason why it is needed to run this script at the root account
curl -qL https://www.npmjs.com/install.sh | sh
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
rm -rf install.sh
## install better discord
git clone https://github.com/BetterDiscord/BetterDiscord.git
npm install
npm run build
npm run inject canary
cd .. && rm -rf BetterDiscord/
## Install yay
cd /opt
git clone https://aur.archlinux.org/yay.git
chown -R "$USER:" yay/
cd yay
makepkg -si --noconfirm
cd ~
# Install thru Yaourt
yes | yaourt -S discord_arch_electron discord-canary-electron-bin discord-ptb insomnia pamac-aur scrcpy telegram-desktop visual-studio-code-bin
# Install thru snap
snap install spotify
# Setup adblocking for Spotify
curl -s https://pastebin.com/raw/QpykwPg6 | tee -a /etc/hosts
reboot

Install npm packages in the root account, and run the following command everytime you install npm packages:

chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment