Remove Python
This commit is contained in:
79
build.sh
79
build.sh
@@ -85,7 +85,7 @@ update_system() {
|
||||
|
||||
install_packages() {
|
||||
log_info "Installing packages..."
|
||||
pacman -S --noconfirm --needed \
|
||||
pacman -Sy --noconfirm --needed \
|
||||
$ESSENTIAL_PACKAGES \
|
||||
$DISPLAY_MANAGER \
|
||||
$WAYLAND_ENVIRONMENT \
|
||||
@@ -94,6 +94,39 @@ install_packages() {
|
||||
$MEDIA_PACKAGES
|
||||
}
|
||||
|
||||
install_nvidia_drivers() {
|
||||
log_info "Checking for NVIDIA GPU..."
|
||||
|
||||
if lspci | grep -i 'vga\|3d' | grep -iq 'nvidia'; then
|
||||
log_success "NVIDIA GPU detected."
|
||||
|
||||
log_info "Installing NVIDIA drivers..."
|
||||
pacman -Sy --noconfirm --needed nvidia nvidia-utils
|
||||
|
||||
log_info "Running mkinitcpio..."
|
||||
mkinitcpio -P
|
||||
|
||||
log_info "Enabling NVIDIA modeset..."
|
||||
mkdir -p /etc/modprobe.d
|
||||
echo "options nvidia_drm modeset=1" > /etc/modprobe.d/nvidia.conf
|
||||
|
||||
else
|
||||
log_info "No NVIDIA GPU detected. Skipping NVIDIA driver installation."
|
||||
fi
|
||||
}
|
||||
|
||||
install_system_files() {
|
||||
log_info "Installing system files from ./system_files to /..."
|
||||
|
||||
if [ -d "system_files" ]; then
|
||||
cp -a ./system_files/. /
|
||||
|
||||
log_success "System files copied to root (/)."
|
||||
else
|
||||
log_warn "'system_files' directory not found."
|
||||
fi
|
||||
}
|
||||
|
||||
apply_gtk_settings() {
|
||||
log_info "Applying GTK settings..."
|
||||
export XDG_RUNTIME_DIR="/run/user/$(id -u "$ORIG_USER")"
|
||||
@@ -143,23 +176,55 @@ run_dotfiles_setup() {
|
||||
log_info "Running dotfiles setup..."
|
||||
cd "$ORIG_PWD"
|
||||
|
||||
[ -f "setup_user.py" ] && sudo -u "$ORIG_USER" HOME="$ORIG_HOME" python3 setup_user.py \
|
||||
|| log_warn "setup_user.py not found."
|
||||
|
||||
[ -f "setup_system.py" ] && python3 setup_system.py \
|
||||
|| log_warn "setup_system.py not found."
|
||||
|
||||
sudo -u "$ORIG_USER" mkdir -p \
|
||||
"$ORIG_HOME/Downloads" \
|
||||
"$ORIG_HOME/Documents" \
|
||||
"$ORIG_HOME/Pictures" \
|
||||
"$ORIG_HOME/Videos" \
|
||||
"$ORIG_HOME/Repositories"
|
||||
|
||||
if [ -d "home" ]; then
|
||||
log_info "Copying files from ./home to $ORIG_HOME..."
|
||||
|
||||
# Copy including hidden files, preserving structure
|
||||
cp -a ./home/. "$ORIG_HOME/"
|
||||
|
||||
# Fix ownership to the original user
|
||||
chown -R "$ORIG_USER:$ORIG_USER" "$ORIG_HOME"
|
||||
|
||||
log_info "Select monitor configuration:"
|
||||
echo "1) monitors-1.conf"
|
||||
echo "2) monitors-2.conf"
|
||||
printf "${MAGENTA}Enter your choice (1 or 2): ${RESET}"
|
||||
read -r MONITOR_CHOICE
|
||||
|
||||
MONITORS_DIR="$ORIG_HOME/.config/hypr"
|
||||
case "$MONITOR_CHOICE" in
|
||||
1)
|
||||
cp "$MONITORS_DIR/monitors-1.conf" "$MONITORS_DIR/monitors.conf"
|
||||
;;
|
||||
2)
|
||||
cp "$MONITORS_DIR/monitors-2.conf" "$MONITORS_DIR/monitors.conf"
|
||||
;;
|
||||
*)
|
||||
log_warn "Invalid choice. Skipping monitor config setup."
|
||||
;;
|
||||
esac
|
||||
|
||||
chown "$ORIG_USER:$ORIG_USER" "$MONITORS_DIR/monitors.conf" 2>/dev/null || true
|
||||
log_success "Monitor config set to monitors.conf"
|
||||
|
||||
log_success "Files copied to user home directory."
|
||||
else
|
||||
log_warn "'home' directory not found in script directory."
|
||||
fi
|
||||
}
|
||||
|
||||
# === Main flow ===
|
||||
update_system
|
||||
install_packages
|
||||
install_nvidia_drivers
|
||||
install_system_files
|
||||
apply_gtk_settings
|
||||
enable_sddm
|
||||
install_sddm_theme
|
||||
|
||||
Reference in New Issue
Block a user