fixes/after.sh
2026-09-30 03:00:10 +03:00

103 lines
No EOL
3.1 KiB
Bash

#!/bin/bash
set -e
read -rp "Enter your username: " USERNAME
if ! id "$USERNAME" &>/dev/null; then
echo "Error: user '$USERNAME' does not exist."
exit 1
fi
# misc stuff
# PACMAN LOVES CANDY
sed -i '/^# Misc options/a ILoveCandy' /etc/pacman.conf
# DISABLE KWALLETD
mkdir -p "/home/$USERNAME/.config"
cat > "/home/$USERNAME/.config/kwalletrc" <<'EOF'
[Wallet]
Enabled=false
EOF
chown "$USERNAME:$USERNAME" "/home/$USERNAME/.config/kwalletrc"
# ENABLE DOLPHIN STORAGE INFO
kwriteconfig6 --file ~/.config/dolphinrc --group General --key ShowStatusBar FullWidth
# INSTALL YAY
pacman -S --needed --noconfirm git base-devel
su - "$USERNAME" <<'EOF'
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si --noconfirm
# INSTALL AUR PACKAGES
yay -S --needed --noconfirm --removemake zsh-theme-powerlevel10k ttf-meslo-nerd coolercontrol-bin mangojuice heroic-games-launcher-bin polymc-qt5-bin open-video-downloader-bin brave-bin onlyoffice-bin
EOF
# SET UP ZSH WITH P10K
chsh -s /bin/zsh
cat > "/home/$USERNAME/.zshrc" <<'EOF'
# ─────────────────────────────────────
# Powerlevel10k
# ─────────────────────────────────────
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
# ─────────────────────────────────────
# Plugins
# ─────────────────────────────────────
# Autosuggestions
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# Syntax highlighting
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# ─────────────────────────────────────
# Powerlevel10k configuration
# ─────────────────────────────────────
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# ─────────────────────────────────────
# Completion
# ─────────────────────────────────────
autoload -Uz compinit
compinit
setopt CORRECT
setopt AUTO_CD
zstyle ':completion:*' completer _complete _approximate
zstyle ':completion:*' menu select
# ─────────────────────────────────────
# History
# ─────────────────────────────────────
HISTFILE="$HOME/.zsh_history"
SAVEHIST=10000
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
EOF
chown "$USERNAME:$USERNAME" "/home/$USERNAME/.zshrc"
# SET UP BACKUPS
systemctl enable --now grub-btrfsd # enabling grub menu entries
snapper -c root create-config / # generate a root conf file
grub-mkconfig -o /boot/grub/grub.cfg # load the options in grub menu
echo "Done."