Skip to content

Instantly share code, notes, and snippets.

@sleepycrow
Last active June 22, 2023 00:32
Show Gist options
  • Save sleepycrow/30d47bc0392129fa85c8b8ddded9086c to your computer and use it in GitHub Desktop.
Save sleepycrow/30d47bc0392129fa85c8b8ddded9086c to your computer and use it in GitHub Desktop.
My Arch postinstall script~ ๐ŸŽ‰๏ธ
# prepare
notify(){
echo -e "Step finished, waiting 5 seconds... \007 "
sleep 5
}
clear
echo "Starting postinstall..."
MY_HOME=$(eval echo ~$SUDO_USER)
echo "My runner is: ${SUDO_USER}"
echo "My home is: ${MY_HOME}"
echo "Starting in 10 seconds..."
sleep 10
# generate polish locale
sed -i 's/#pl_PL.UTF-8 UTF-8/pl_PL.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
notify
# install native packages
# go is for compiling yay later
pacman -Syu --needed --noconfirm go git base-devel gnome gnome-tweaks dconf-editor gthumb geary flatpak flatpak-builder code rhythmbox gimp man-db yt-dlp zsh os-prober vim
pacman -Rsn --noconfirm gnome-music gnome-photos eog gnome-boxes gnome-books
pacman -Syu ttf-droid ttf-ibm-plex
notify
# oh my god you're fucking with me make vi run vim
ln -s vim /usr/bin/vi
ln -s vim.1.gz /usr/share/man/man1/vi.1.gz
# set up GRUB
sed -i 's/GRUB_DEFAULT=.*/GRUB_DEFAULT=saved/' /etc/default/grub
sed -i 's/#GRUB_SAVEDEFAULT=.*/GRUB_SAVEDEFAULT=true/' /etc/default/grub
sed -i 's/#GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=false/' /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
notify
# install flatpaks
flatpak config --set languages "pl;en"
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub de.haeckerfelix.Fragments org.gnome.gitlab.somas.Apostrophe com.github.johnfactotum.Foliate com.github.tchx84.Flatseal org.libreoffice.LibreOffice com.discordapp.Discord im.riot.Riot org.telegram.desktop
notify
# install yay
sudo -u $SUDO_USER git clone https://aur.archlinux.org/yay.git $MY_HOME/yay
cd $MY_HOME/yay
sudo -u $SUDO_USER makepkg --noconfirm
pacman -U --noconfirm yay-*.tar.zst
cd $MY_HOME
rm -rf $MY_HOME/yay
notify
# install AUR packages
yay -Syu --noconfirm lite-xl menulibre gnome-shell-extension-installer
notify
# gnome extensions
sudo -u $SUDO_USER gnome-extensions enable places-menu@gnome-shell-extensions.gcampax.github.com
# installs caffeine, appindicator support, top panel workspace scroll, miniview
sudo -u $SUDO_USER gnome-shell-extension-installer 517 615 701 1459 --yes
notify
# compile eolie
#flatpak install -y org.gnome.Platform//42 org.gnome.Sdk//42
#sudo -u $SUDO_USER mkdir $MY_HOME/Projekty
#sudo -u $SUDO_USER git clone https://github.com/sleepycrow/eolie.git $MY_HOME/Projekty/eolie
#cd $MY_HOME/Projekty/eolie
#sudo -u $SUDO_USER ./build-prod.sh
#notify
# install fonts for the ZSH theme
mkdir -p /usr/local/share/fonts
cd /usr/local/share/fonts
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
wget https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf
fc-cache -f -v
notify
# we can't go any farther in bash, just print the instructions
sudo -u $SUDO_USER touch $MY_HOME/afterwards
echo "--------------------------------------------------------------------------------" >> $MY_HOME/afterwards
echo "If this is the main computer, run the following to get the full flatpak suite:" >> $MY_HOME/afterwards
echo "\$ flatpak install -y flathub org.kde.krita com.obsproject.Studio com.calibre_ebook.Calibre" >> $MY_HOME/afterwards
echo "\$ sudo pacman -Syu steam" >> $MY_HOME/afterwards
echo "\$ wget -o itch \"https://itch.io/app/download?platform=linux\" && chmod +x itch && ./itch" >> $MY_HOME/afterwards
echo "--------------------------------------------------------------------------------" >> $MY_HOME/afterwards
echo "To finish you ZSH setup, switch your font to MesloLGS, and run the following:" >> $MY_HOME/afterwards
echo "\$ sh -c \"\$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)\"" >> $MY_HOME/afterwards
echo "\$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \${ZSH_CUSTOM:-\$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" >> $MY_HOME/afterwards
echo "Then, set ZSH_THEME=\"powerlevel10k/powerlevel10k\" in ~/.zshrc, and relaunch the shell." >> $MY_HOME/afterwards
echo "--------------------------------------------------------------------------------" >> $MY_HOME/afterwards
echo "You can find these instructions at any time in ~/afterwards" >> $MY_HOME/afterwards
echo "--------------------------------------------------------------------------------" >> $MY_HOME/afterwards
cat $MY_HOME/afterwards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment