-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ps1
77 lines (62 loc) · 3.14 KB
/
install.ps1
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
Write-Host @"
@iholston's ███████╗██╗██╗ ███████╗███████╗
██████╗ █████╗ ████████╗██╔════╝██║██║ ██╔════╝██╔════╝
██╔══██╗██╔══██╗╚══██╔══╝█████╗ ██║██║ █████╗ ███████╗
██║ ██║██║ ██║ ██║ ██╔══╝ ██║██║ ██╔══╝ ╚════██║
██████╔╝╚█████╔╝ ██║ ██║ ██║███████╗███████╗███████║
╚═════╝ ╚════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝
https://github.com/iholston/dotfiles
"@
# Check if running as Admin
if (!([Security.Principal.WindowsPrincipal] `
[Security.Principal.WindowsIdentity]::GetCurrent() `
).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host " Error. Program must be run as administrator."
Read-Host -Prompt " Press Enter to exit"
Exit
}
$ErrorActionPreference = "Continue"
# Install Apps
$apps = @(
# Terminal
"wez.wezterm"
"sxyazi.yazi"
"Git.Git"
"7zip.7zip"
"jqlang.jq"
"sharkdp.fd"
"BurntSushi.ripgrep.MSVC"
"junegunn.fzf"
"ajeetdsouza.zoxide"
"ImageMagick.ImageMagick"
# Shell
"Microsoft.Powershell"
"JanDeDobbeleer.OhMyPosh"
"DEVCOM.JetBrainsMonoNerdFont"
# Text/Code Editor
"Neovim.Neovim"
"zig.zig" # required for neovim packages
# Other
"LGUG2Z.komorebi"
"AutoHotkey.AutoHotkey"
"Clement.bottom"
)
foreach ($app in $apps) {
Write-Output "Installing $app"
winget install --accept-package-agreements --accept-source-agreements $app -s winget
Write-Host ""
Write-Host ""
}
Install-Module -Name Terminal-Icons -Repository PSGallery
# Create .config folder symlink to dotfiles repo
New-Item -Path "$HOME\.config" -ItemType SymbolicLink -Value "$(Get-Location)"
# Add app specific environment variables
[Environment]::SetEnvironmentVariable("YAZI_FILE_ONE", "C:\Program Files\Git\usr\bin\file.exe", [System.EnvironmentVariableTarget]::User) # # https://yazi-rs.github.io/docs/installation#windows
[Environment]::SetEnvironmentVariable("YAZI_CONFIG_HOME", "$HOME\.config\yazi", [System.EnvironmentVariableTarget]::User) # https://yazi-rs.github.io/docs/configuration/overview/
[Environment]::SetEnvironmentVariable("KOMOREBI_CONFIG_HOME", "$HOME\.config\komorebi", [System.EnvironmentVariableTarget]::User) # https://lgug2z.github.io/komorebi/common-workflows/komorebi-config-home.html
[Environment]::SetEnvironmentVariable("XDG_CONFIG_HOME", "$HOME\.config", [System.EnvironmentVariableTarget]::User)
# Set user_profile for pwsh
$pattern = '. $env:USERPROFILE\.config\pwsh\profile.ps1'
if ($null -eq (Select-String -Path "$PROFILE" -Pattern $([regex]::escape($pattern)))) {
Add-Content -Path "$PROFILE" -Value $pattern
}