dotfiles/install_windows.ps1

65 lines
2.4 KiB
PowerShell
Raw Normal View History

2024-11-24 20:14:55 +00:00
Import-Module ./util/chocolatey.psm1
Import-Module ./util/windows.psm1
2024-11-24 20:14:10 +00:00
Import-Module ./util/winget.psm1
2024-11-24 20:15:14 +00:00
Import-Module ./util/wsl.psm1
2024-11-24 20:14:10 +00:00
# (Optionally) Install required Software
WingetInstall
ChocolateyInstall
WSLInstall
2024-11-24 20:14:10 +00:00
Write-Host "Installation Steps complete!" -ForegroundColor Cyan
$continue = Read-Host "Continue with configuration? [Y/n]"
if ($continue.ToLower() -eq 'n')
{ return
}
2024-08-27 10:32:13 +00:00
# Define paths for tools and configurations
$dotfilesRepo = (Get-Location).Path
2024-08-27 10:32:13 +00:00
$alacrittyConfigDir = "$env:APPDATA\alacritty"
$psProfile = "$env:USERPROFILE\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"
2024-08-27 10:33:44 +00:00
2024-08-27 10:35:30 +00:00
# Setting up Alacritty Configuration
Write-Host "Setting up Alacritty configuration..." -ForegroundColor Cyan
ProcessUrlFiles -source "$dotfilesRepo\alacritty" -destination $alacrittyConfigDir
2024-08-27 10:35:30 +00:00
# Copy the main Alacritty configuration file
CopyFileWithPrompt "$dotfilesRepo\alacritty\alacritty.toml" "$alacrittyConfigDir\alacritty.toml"
# Setting up Neovim Configuration
Write-Host "Setting up Neovim configuration..." -ForegroundColor Cyan
$ubuntu = wsl.exe -l --all | Where-Object { $_.Replace("`0", "") -match '^Ubuntu' }
if ($null -eq $ubuntu)
{ ProcessUrlFiles -source "$dotfilesRepo\nvim" -destination "$env:LOCALAPPDATA"
} else
2024-11-24 20:15:14 +00:00
{ InstallWSLNeovim -source "$dotfilesRepo\nvim"
}
2024-08-27 10:35:30 +00:00
# Setting up PowerShell Profile
Write-Host "Setting up PowerShell profile..." -ForegroundColor Cyan
# Create local PowerShell profile directory
$psDir = Split-Path -Path $psProfile
if (-not (Test-Path $psDir))
{ New-Item -ItemType Directory -Path $psDir | Out-Null
}
# Copy existing startup script to destination
2024-08-27 10:35:30 +00:00
CopyFileWithPrompt "$dotfilesRepo\PowerShell\Microsoft.PowerShell_profile.ps1" $psProfile
# Setting up self-made ProxySwitcher
Write-Host "============================================" -ForegroundColor DarkGray
Write-Host "Setting up ProxySwitcher via subscript..." -ForegroundColor Cyan
Invoke-RestMethod 'https://raw.githubusercontent.com/Baipyrus/ProxySwitcher/main/install.ps1' | Invoke-Expression
Write-Host "============================================" -ForegroundColor DarkGray
2024-08-27 13:38:57 +00:00
# Installing Nerd Fonts
Write-Host "Installing Nerd Fonts..." -ForegroundColor Cyan
ProcessUrlFiles -source "$dotfilesRepo\nerd-fonts" -fileExt ".zip" -progress $false
Get-ChildItem -Path "$env:TMP\nerd-fonts-config" -Filter "*.zip" | `
ForEach-Object { InstallNerdFont -source $_.FullName }
2024-08-27 13:38:57 +00:00
2024-08-27 10:35:30 +00:00
# Final message
Write-Host "Windows setup complete!" -ForegroundColor Green