~kris/dots

sdeploy

ref: ebdf5308ccb6316f7dc8e882bb711780bdad077f sdeploy/ksd-artix/post-install.sh -rwxr-xr-x 5.2 KiB
ebdf5308 — Kris Yotam Rename ksd-arch to ksd-artix 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
#!/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 "$@"