add code ext

This commit is contained in:
2025-08-26 22:29:09 +02:00
parent dd99477410
commit ed8942ea42

View File

@@ -68,27 +68,75 @@ sudo apt update
sudo apt install -y code sudo apt install -y code
check_command "Visual Studio Code" check_command "Visual Studio Code"
# Installazione estensioni VS Code # Creazione profili e installazione estensioni VS Code
print_status "Installazione estensioni VS Code..." print_status "Creazione profili e installazione estensioni VS Code..."
# Python
code --install-extension ms-python.python # Aspetta che VS Code sia completamente installato
code --install-extension ms-python.flake8 sleep 2
code --install-extension ms-python.python-tools
code --install-extension ms-python.vscode-pylance # Prima creiamo i profili avviando VS Code con ciascun profilo
code --install-extension ms-python.vscode-pyright print_status "Creazione profili VS Code..."
code --install-extension ms-python.debugpy
# Rust # Funzione per creare un profilo
code --install-extension rust-lang.rust-analyzer create_vscode_profile() {
code --install-extension formulahendry.code-runner local profile_name="$1"
code --install-extension vadimcn.vscode-lldb print_status "Creando profilo $profile_name..."
code --install-extension fill-labs.dependi
code --install-extension usernamehw.errorlens # Avvia VS Code con il profilo per crearlo, poi lo chiude subito
code --install-extension tamasfe.even-better-toml timeout 10 code --profile "$profile_name" --wait /tmp 2>/dev/null || true
# Git sleep 2
code --install-extension ms-vscode.vscode-git
code --install-extension charliermarsh.ruff # Chiude tutte le istanze di VS Code
code --install-extension google.geminicodeassist pkill -f "code.*$profile_name" 2>/dev/null || true
print_success "Estensioni VS Code installate" sleep 1
}
# Crea i profili
create_vscode_profile "Default"
create_vscode_profile "Python"
create_vscode_profile "Rust"
create_vscode_profile "Web"
print_success "Profili VS Code creati"
# Ora installiamo le estensioni per ogni profilo
print_status "Installazione estensioni per profilo Default..."
code --profile "Default" --install-extension ms-vscode.vscode-git
code --profile "Default" --install-extension charliermarsh.ruff
code --profile "Default" --install-extension google.geminicodeassist
code --profile "Default" --install-extension ms-vscode.theme-tomorrowkit
code --profile "Default" --install-extension ms-vscode.vscode-git
code --profile "Default" --install-extension pkief.material-icon-theme
check_command "Estensioni profilo Default"
print_status "Installazione estensioni per profilo Python..."
code --profile "Python" --install-extension ms-python.black-formatter
code --profile "Python" --install-extension ms-python.debugpy
code --profile "Python" --install-extension ms-python.flake8
code --profile "Python" --install-extension ms-python.pylint
code --profile "Python" --install-extension ms-python.python
code --profile "Python" --install-extension ms-python.python-tools
code --profile "Python" --install-extension ms-python.vscode-pylance
code --profile "Python" --install-extension ms-python.vscode-pyright
check_command "Estensioni profilo Python"
print_status "Installazione estensioni per profilo Rust..."
code --profile "Rust" --install-extension fill-labs.dependi
code --profile "Rust" --install-extension formulahendry.code-runner
code --profile "Rust" --install-extension rust-lang.rust-analyzer
code --profile "Rust" --install-extension serayuzgur.crates
code --profile "Rust" --install-extension tamasfe.even-better-toml
code --profile "Rust" --install-extension usernamehw.errorlens
check_command "Estensioni profilo Rust"
print_status "Installazione estensioni per profilo Web..."
code --profile "Web" --install-extension ms-vscode.vscode-typescript-next
code --profile "Web" --install-extension bradlc.vscode-tailwindcss
code --profile "Web" --install-extension formulahendry.auto-rename-tag
code --profile "Web" --install-extension esbenp.prettier-vscode
check_command "Estensioni profilo Web"
print_success "Tutti i profili VS Code configurati (Default, Python, Rust, Web)"
# === FILEZILLA === # === FILEZILLA ===
print_status "Installazione FileZilla..." print_status "Installazione FileZilla..."
@@ -197,19 +245,19 @@ rm -rf "$TEMP_REPO_DIR"
print_status "Cloning repository alex/desktop-app..." print_status "Cloning repository alex/desktop-app..."
if git clone "https://$GITEA_USERNAME:$GITEA_PASSWORD@gitbat.duckdns.org:44443/alex/desktop-app.git" "$TEMP_REPO_DIR" 2>/dev/null; then if git clone "https://$GITEA_USERNAME:$GITEA_PASSWORD@gitbat.duckdns.org:44443/alex/desktop-app.git" "$TEMP_REPO_DIR" 2>/dev/null; then
print_success "Repository clonato con successo" print_success "Repository clonato con successo"
# Copia tutti i file .desktop dal repository # Copia tutti i file .desktop dal repository
if [ -d "$TEMP_REPO_DIR" ] && [ "$(ls -A $TEMP_REPO_DIR/*.desktop 2>/dev/null)" ]; then if [ -d "$TEMP_REPO_DIR" ] && [ "$(ls -A $TEMP_REPO_DIR/*.desktop 2>/dev/null)" ]; then
cp "$TEMP_REPO_DIR"/*.desktop "$DESKTOP_DIR/" 2>/dev/null || true cp "$TEMP_REPO_DIR"/*.desktop "$DESKTOP_DIR/" 2>/dev/null || true
# Rende eseguibili i file .desktop # Rende eseguibili i file .desktop
chmod +x "$DESKTOP_DIR"/*.desktop 2>/dev/null || true chmod +x "$DESKTOP_DIR"/*.desktop 2>/dev/null || true
# Aggiorna il database delle applicazioni # Aggiorna il database delle applicazioni
update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true
print_success "File .desktop installati dal repository Gitea" print_success "File .desktop installati dal repository Gitea"
# Lista dei file installati # Lista dei file installati
INSTALLED_FILES=$(ls "$TEMP_REPO_DIR"/*.desktop 2>/dev/null | xargs -n1 basename) INSTALLED_FILES=$(ls "$TEMP_REPO_DIR"/*.desktop 2>/dev/null | xargs -n1 basename)
if [ ! -z "$INSTALLED_FILES" ]; then if [ ! -z "$INSTALLED_FILES" ]; then
@@ -219,13 +267,13 @@ if git clone "https://$GITEA_USERNAME:$GITEA_PASSWORD@gitbat.duckdns.org:44443/a
else else
print_warning "Nessun file .desktop trovato nel repository" print_warning "Nessun file .desktop trovato nel repository"
fi fi
# Pulizia # Pulizia
rm -rf "$TEMP_REPO_DIR" rm -rf "$TEMP_REPO_DIR"
else else
print_error "Impossibile clonare il repository. Verifica le credenziali e la connessione." print_error "Impossibile clonare il repository. Verifica le credenziali e la connessione."
print_status "URL repository: https://gitbat.duckdns.org:44443/alex/desktop-app" print_status "URL repository: https://gitbat.duckdns.org:44443/alex/desktop-app"
# Fallback: prova con cartella locale # Fallback: prova con cartella locale
BACKUP_DESKTOP_DIR="./desktop_backup" BACKUP_DESKTOP_DIR="./desktop_backup"
if [ -d "$BACKUP_DESKTOP_DIR" ]; then if [ -d "$BACKUP_DESKTOP_DIR" ]; then
@@ -252,7 +300,11 @@ fi
print_success "=== INSTALLAZIONE COMPLETATA! ===" print_success "=== INSTALLAZIONE COMPLETATA! ==="
print_status "Applicazioni installate:" print_status "Applicazioni installate:"
echo " ✓ Google Chrome" echo " ✓ Google Chrome"
echo " ✓ Visual Studio Code (con estensioni Python, Rust, Git, UV, Ruff)" echo " ✓ Visual Studio Code con 4 profili configurati:"
echo " - Default (Git, temi)"
echo " - Python (Python, Ruff, Flake8, Black, Pylint)"
echo " - Rust (Rust Analyzer, LLDB, Crates)"
echo " - Web (TypeScript, Tailwind, Auto-rename, Prettier)"
echo " ✓ FileZilla" echo " ✓ FileZilla"
echo " ✓ DBeaver" echo " ✓ DBeaver"
echo " ✓ Warp Terminal" echo " ✓ Warp Terminal"
@@ -277,6 +329,16 @@ echo "Username Git globale: $GIT_USERNAME"
echo "Email Git globale: $GIT_EMAIL" echo "Email Git globale: $GIT_EMAIL"
echo "Username Gitea: $GITEA_USERNAME" echo "Username Gitea: $GITEA_USERNAME"
echo "" echo ""
print_status "=== UTILIZZO PROFILI VS CODE ==="
echo "Per aprire VS Code con un profilo specifico:"
echo " code --profile \"Default\" /percorso/progetto # Profilo generale"
echo " code --profile \"Python\" /percorso/progetto # Profilo Python"
echo " code --profile \"Rust\" /percorso/progetto # Profilo Rust"
echo " code --profile \"Web\" /percorso/progetto # Profilo Web"
echo ""
echo "Puoi anche cambiare profilo dall'interfaccia: File → Preferences → Profiles"
echo ""
echo "Per clonare repository da Gitea:" echo "Per clonare repository da Gitea:"
echo " git clone https://gitbat.duckdns.org:44443/user/repo.git" echo " git clone https://gitbat.duckdns.org:44443/user/repo.git"