#!/bin/sh
# ============================================================================
# LazyKris Post-Install Script
# ============================================================================
#
# This script installs optional large packages that take a long time.
# Run this AFTER the main lazykris.sh installation completes.
#
# Usage:
# ./post-install.sh [option]
#
# Options:
# all - Install everything
# texlive - Install full LaTeX suite
# davinci - Install DaVinci Resolve
# help - Show this help
#
# ============================================================================
set -e
# Colors
RED='\033[1;31m'
GREEN='\033[1;32m'
BLUE='\033[1;34m'
YELLOW='\033[1;33m'
NC='\033[0m'
info() { printf "${BLUE}==>${NC} %s\n" "$1"; }
success() { printf "${GREEN}==>${NC} %s\n" "$1"; }
warn() { printf "${YELLOW}==>${NC} %s\n" "$1"; }
error() { printf "${RED}Error:${NC} %s\n" "$1" >&2; exit 1; }
# Check if running as regular user (not root)
check_user() {
if [ "$(id -u)" = "0" ]; then
error "Run this script as your regular user, not root."
fi
}
# Check for yay
check_aur_helper() {
if ! command -v yay >/dev/null 2>&1; then
error "yay is not installed. Run lazykris.sh first."
fi
}
# ============================================================================
# TEXLIVE - Full LaTeX Suite (~2-3GB)
# ============================================================================
install_texlive() {
info "Installing TeX Live (full LaTeX suite)..."
warn "This will download ~2-3GB of packages."
echo ""
read -p "Continue? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
;;
*)
warn "Skipping TeX Live installation."
return 0
;;
esac
info "Installing TeX Live packages..."
# Core packages
sudo pacman -S --noconfirm --needed \
texlive-basic \
texlive-latex \
texlive-latexrecommended \
texlive-latexextra \
texlive-fontsrecommended \
texlive-fontsextra \
texlive-fontutils \
texlive-bibtexextra \
texlive-binextra \
texlive-mathscience \
texlive-pictures \
texlive-xetex \
texlive-luatex \
texlive-plaingeneric
# Optional packages (uncomment if needed)
# sudo pacman -S --noconfirm --needed \
# texlive-context \
# texlive-formatsextra \
# texlive-games \
# texlive-humanities \
# texlive-metapost \
# texlive-music \
# texlive-pstricks \
# texlive-publishers
success "TeX Live installation complete!"
echo ""
echo "Test with: pdflatex --version"
echo "Compile a document: pdflatex document.tex"
}
# ============================================================================
# DAVINCI RESOLVE - Professional Video Editor (~3GB)
# ============================================================================
install_davinci() {
info "Installing DaVinci Resolve..."
warn "This will download ~3GB and may take 30+ minutes."
echo ""
echo "Note: DaVinci Resolve requires:"
echo " - NVIDIA GPU with proprietary drivers, OR"
echo " - AMD GPU with ROCm support"
echo ""
read -p "Continue? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
;;
*)
warn "Skipping DaVinci Resolve installation."
return 0
;;
esac
info "Installing DaVinci Resolve from AUR..."
yay -S --noconfirm davinci-resolve
success "DaVinci Resolve installation complete!"
echo ""
echo "Launch with: davinci-resolve"
echo ""
echo "If you have issues, you may need to install GPU drivers:"
echo " NVIDIA: sudo pacman -S nvidia nvidia-utils"
echo " AMD: yay -S rocm-opencl-runtime"
}
# ============================================================================
# HELP
# ============================================================================
show_help() {
echo "LazyKris Post-Install Script"
echo ""
echo "Usage: $0 [option]"
echo ""
echo "Options:"
echo " all Install everything (texlive + davinci)"
echo " texlive Install full TeX Live suite (~2-3GB)"
echo " davinci Install DaVinci Resolve (~3GB)"
echo " help Show this help message"
echo ""
echo "Examples:"
echo " $0 texlive # Install just LaTeX"
echo " $0 all # Install everything"
echo ""
}
# ============================================================================
# MAIN
# ============================================================================
main() {
check_user
check_aur_helper
case "${1:-help}" in
all)
install_texlive
echo ""
install_davinci
echo ""
success "All post-install packages complete!"
;;
texlive|tex|latex)
install_texlive
;;
davinci|resolve)
install_davinci
;;
help|-h|--help)
show_help
;;
*)
error "Unknown option: $1"
show_help
exit 1
;;
esac
}
main "$@"