2024-11-24 17:41:24 +00:00
|
|
|
Import-Module ./util/windows.psm1
|
|
|
|
|
|
|
|
|
2024-08-27 10:32:13 +00:00
|
|
|
# Define paths for tools and configurations
|
|
|
|
$dotfilesRepo = "$env:TMP\dotfiles"
|
|
|
|
$alacrittyConfigDir = "$env:APPDATA\alacritty"
|
|
|
|
$psProfile = "$env:USERPROFILE\Documents\PowerShell\Microsoft.PowerShell_profile.ps1"
|
|
|
|
$repoUrl = "https://github.com/Baipyrus/dotfiles.git"
|
2024-08-27 10:33:44 +00:00
|
|
|
|
2024-08-27 10:34:32 +00:00
|
|
|
# Check if the script is running inside the dotfiles repository
|
|
|
|
$currentDir = (Get-Location).Path
|
|
|
|
|
2024-08-27 10:35:51 +00:00
|
|
|
|
2024-11-24 17:41:24 +00:00
|
|
|
ReadyDotfilesRepo -cwd $currentDir -url $repoUrl -destination $dotfilesRepo
|
2024-08-27 10:35:30 +00:00
|
|
|
|
2024-08-27 10:35:51 +00:00
|
|
|
# Setting up Alacritty Configuration
|
|
|
|
Write-Host "Setting up Alacritty configuration..." -ForegroundColor Cyan
|
2024-11-24 20:12:23 +00:00
|
|
|
ProcessUrlFiles -source "$dotfilesRepo\alacritty" -destination $alacrittyConfigDir
|
2024-08-27 10:35:51 +00:00
|
|
|
|
2024-08-27 10:35:30 +00:00
|
|
|
# Copy the main Alacritty configuration file
|
|
|
|
CopyFileWithPrompt "$dotfilesRepo\alacritty\alacritty.toml" "$alacrittyConfigDir\alacritty.toml"
|
|
|
|
|
2024-08-27 10:35:51 +00:00
|
|
|
# Setting up Neovim Configuration
|
|
|
|
Write-Host "Setting up Neovim configuration..." -ForegroundColor Cyan
|
2024-10-21 19:07:41 +00:00
|
|
|
$ubuntu = wsl.exe -l --all | Where-Object { $_.Replace("`0", "") -match '^Ubuntu' }
|
|
|
|
if ($null -eq $ubuntu)
|
2024-11-24 20:12:23 +00:00
|
|
|
{ ProcessUrlFiles -source "$dotfilesRepo\nvim" -destination "$env:LOCALAPPDATA"
|
2024-10-21 19:08:05 +00:00
|
|
|
} else
|
|
|
|
{
|
2024-10-21 21:46:06 +00:00
|
|
|
# TODO: Expand into generic WSL setup while installing required dev tools
|
2024-10-21 19:08:05 +00:00
|
|
|
ProcessUrlFiles -sourceDir "$dotfilesRepo\nvim"
|
|
|
|
Set-Location "$env:TMP\nvim-config"
|
2024-10-21 20:15:54 +00:00
|
|
|
Write-Host "Copying (forcably) configuration to WSL..." -ForegroundColor Yellow
|
2024-10-21 19:08:05 +00:00
|
|
|
wsl.exe cp -rf . ~/.config/ 2>$null | Out-Null
|
|
|
|
Set-Location -
|
2024-10-21 19:07:41 +00:00
|
|
|
}
|
2024-08-27 10:35:51 +00:00
|
|
|
|
2024-08-27 10:35:30 +00:00
|
|
|
# Setting up PowerShell Profile
|
|
|
|
Write-Host "Setting up PowerShell profile..." -ForegroundColor Cyan
|
|
|
|
CopyFileWithPrompt "$dotfilesRepo\PowerShell\Microsoft.PowerShell_profile.ps1" $psProfile
|
|
|
|
|
2024-09-02 06:55:38 +00:00
|
|
|
# Setting up self-made ProxySwitcher
|
2024-10-21 19:05:57 +00:00
|
|
|
Write-Host "============================================" -ForegroundColor DarkGray
|
|
|
|
Write-Host "Setting up ProxySwitcher via subscript..." -ForegroundColor Cyan
|
2024-09-02 06:55:38 +00:00
|
|
|
Invoke-RestMethod 'https://raw.githubusercontent.com/Baipyrus/ProxySwitcher/main/install.ps1' | Invoke-Expression
|
2024-10-21 19:05:57 +00:00
|
|
|
Write-Host "============================================" -ForegroundColor DarkGray
|
2024-09-02 06:55:38 +00:00
|
|
|
|
2024-08-27 13:38:57 +00:00
|
|
|
# Installing Nerd Fonts
|
|
|
|
Write-Host "Installing Nerd Fonts..." -ForegroundColor Cyan
|
2024-11-24 20:12:23 +00:00
|
|
|
ProcessUrlFiles -source "$dotfilesRepo\nerd-fonts" -fileExt ".zip"
|
2024-10-21 17:53:27 +00:00
|
|
|
UnzipAndInstall -source "$dotfilesRepo\nerd-fonts"
|
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
|