docs: Update README and documentation for lxs multi-tool across Linux and Windows platforms.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<#
|
||||
LXS - Browsers and media (Windows)
|
||||
Description: Browsers and media players installed through winget.
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
#>
|
||||
|
||||
# Load LXS common library (colors, UI helpers, spinner, loggers, guards).
|
||||
# Prefers the sibling ..\lib\common.ps1 (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone.
|
||||
$LxsRawBase = if ($env:LXS_RAW_BASE) { $env:LXS_RAW_BASE } else { 'https://git.hyko.cx/hykocx/lxs/raw/branch/main' }
|
||||
if (-not $env:LXS_RAW_PLATFORM_BASE) { $env:LXS_RAW_PLATFORM_BASE = "$LxsRawBase/windows" }
|
||||
$LxsLibPath = if ($PSScriptRoot) { Join-Path $PSScriptRoot '..\lib\common.ps1' } else { $null }
|
||||
if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
. $LxsLibPath
|
||||
} else {
|
||||
try {
|
||||
$LxsLibSource = Invoke-RestMethod -Uri "$env:LXS_RAW_PLATFORM_BASE/lib/common.ps1" -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
}
|
||||
|
||||
$env:LXS_LOG_FILE = Join-Path (Get-LxsTempDir) 'lxs_browsers.log'
|
||||
|
||||
if (-not (Assert-LxsWindows)) { exit 1 }
|
||||
|
||||
$LxsBrowserPackages = @(
|
||||
@{ Name = 'LibreWolf'; Id = 'LibreWolf.LibreWolf' }
|
||||
@{ Name = 'Firefox'; Id = 'Mozilla.Firefox' }
|
||||
@{ Name = 'Brave'; Id = 'Brave.Brave' }
|
||||
@{ Name = 'Chrome'; Id = 'Google.Chrome' }
|
||||
@{ Name = 'VLC'; Id = 'VideoLAN.VLC' }
|
||||
@{ Name = 'OBS Studio'; Id = 'OBSProject.OBSStudio' }
|
||||
)
|
||||
|
||||
Invoke-LxsPackageMenu -Title 'BROWSERS & MEDIA' -Packages $LxsBrowserPackages `
|
||||
-Note 'LibreWolf is a hardened Firefox fork with telemetry stripped out.' | Out-Null
|
||||
exit 0
|
||||
@@ -0,0 +1,202 @@
|
||||
<#
|
||||
LXS - Claude Code (Windows)
|
||||
Description: Install and check the Claude Code CLI.
|
||||
|
||||
Two supported install methods, both official:
|
||||
- winget (Anthropic.ClaudeCode) — does not auto-update
|
||||
- the native installer from claude.ai — updates itself in the background
|
||||
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
#>
|
||||
|
||||
# Load LXS common library (colors, UI helpers, spinner, loggers, guards).
|
||||
# Prefers the sibling ..\lib\common.ps1 (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone.
|
||||
$LxsRawBase = if ($env:LXS_RAW_BASE) { $env:LXS_RAW_BASE } else { 'https://git.hyko.cx/hykocx/lxs/raw/branch/main' }
|
||||
if (-not $env:LXS_RAW_PLATFORM_BASE) { $env:LXS_RAW_PLATFORM_BASE = "$LxsRawBase/windows" }
|
||||
$LxsLibPath = if ($PSScriptRoot) { Join-Path $PSScriptRoot '..\lib\common.ps1' } else { $null }
|
||||
if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
. $LxsLibPath
|
||||
} else {
|
||||
try {
|
||||
$LxsLibSource = Invoke-RestMethod -Uri "$env:LXS_RAW_PLATFORM_BASE/lib/common.ps1" -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
}
|
||||
|
||||
$env:LXS_LOG_FILE = Join-Path (Get-LxsTempDir) 'lxs_claude_code.log'
|
||||
|
||||
if (-not (Assert-LxsWindows)) { exit 1 }
|
||||
|
||||
$LxsClaudeInstallerUrl = 'https://claude.ai/install.ps1'
|
||||
|
||||
function Get-LxsClaudeCommand {
|
||||
return (Get-Command claude -ErrorAction SilentlyContinue)
|
||||
}
|
||||
|
||||
function Show-LxsClaudeStatus {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'CLAUDE CODE STATUS'
|
||||
Write-Host ''
|
||||
$cmd = Get-LxsClaudeCommand
|
||||
if (-not $cmd) {
|
||||
Write-Host " $($script:Gray)claude is not on your PATH$($script:NC)"
|
||||
Write-Host ''
|
||||
Write-Host "$($script:Gray)If you just installed it, open a new terminal so the PATH change$($script:NC)"
|
||||
Write-Host "$($script:Gray)takes effect.$($script:NC)"
|
||||
Write-Host ''
|
||||
return
|
||||
}
|
||||
Write-LxsOk "Found: $($cmd.Source)"
|
||||
Write-Host ''
|
||||
& claude --version
|
||||
Write-Host ''
|
||||
Show-LxsSeparator
|
||||
Write-Host ''
|
||||
Write-LxsInfo 'Running claude doctor (read-only diagnostics)...'
|
||||
Write-Host ''
|
||||
& claude doctor
|
||||
}
|
||||
|
||||
function Install-LxsClaudeWinget {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'INSTALL VIA WINGET'
|
||||
Write-Host ''
|
||||
Write-Host 'Installs the Anthropic.ClaudeCode package.'
|
||||
Write-Host ''
|
||||
Write-Host "$($script:Gray)winget installs do not update themselves — run option 5, or$($script:NC)"
|
||||
Write-Host "$($script:Gray)$('winget upgrade Anthropic.ClaudeCode'), to get new versions.$($script:NC)"
|
||||
Write-Host ''
|
||||
if (-not (Confirm-LxsAction -Question 'Install Claude Code with winget?' -DefaultYes)) {
|
||||
Write-LxsInfo 'Cancelled.'
|
||||
return
|
||||
}
|
||||
Write-Host ''
|
||||
if (Install-LxsWingetPackage -Id 'Anthropic.ClaudeCode' -Name 'Claude Code') {
|
||||
Write-Host ''
|
||||
Write-LxsOk 'Open a new terminal, then run: claude'
|
||||
}
|
||||
}
|
||||
|
||||
function Install-LxsClaudeNative {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'INSTALL VIA THE NATIVE INSTALLER'
|
||||
Write-Host ''
|
||||
Write-Host 'This is the install method Anthropic documents as recommended.'
|
||||
Write-Host 'It downloads and runs a script from claude.ai:'
|
||||
Write-Host ''
|
||||
Write-Host " $($script:White)irm $LxsClaudeInstallerUrl | iex$($script:NC)"
|
||||
Write-Host ''
|
||||
Write-Host "$($script:Gray)It installs into your user profile (no admin needed) and keeps$($script:NC)"
|
||||
Write-Host "$($script:Gray)itself updated in the background.$($script:NC)"
|
||||
Write-Host ''
|
||||
if (-not (Confirm-LxsAction -Question 'Download and run that installer now?')) {
|
||||
Write-LxsInfo 'Cancelled.'
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host ''
|
||||
Write-LxsInfo "Fetching $LxsClaudeInstallerUrl..."
|
||||
try {
|
||||
$installer = Invoke-RestMethod -Uri $LxsClaudeInstallerUrl -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-LxsErr "Download failed: $($_.Exception.Message)"
|
||||
return
|
||||
}
|
||||
Write-LxsOk 'Installer downloaded'
|
||||
Write-Host ''
|
||||
Show-LxsSeparator
|
||||
Write-Host ''
|
||||
try {
|
||||
& ([scriptblock]::Create($installer))
|
||||
} catch {
|
||||
Write-LxsErr "Installer failed: $($_.Exception.Message)"
|
||||
return
|
||||
}
|
||||
Write-Host ''
|
||||
Show-LxsSeparator
|
||||
Write-Host ''
|
||||
Write-LxsOk 'Open a new terminal, then run: claude'
|
||||
}
|
||||
|
||||
function Install-LxsGitForWindows {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'GIT FOR WINDOWS'
|
||||
Write-Host ''
|
||||
Write-Host 'Optional but recommended alongside Claude Code: with Git for Windows'
|
||||
Write-Host 'installed, Claude Code uses Git Bash for its Bash tool. Without it,'
|
||||
Write-Host 'it falls back to the PowerShell tool.'
|
||||
Write-Host ''
|
||||
if (-not (Confirm-LxsAction -Question 'Install Git for Windows?' -DefaultYes)) {
|
||||
Write-LxsInfo 'Cancelled.'
|
||||
return
|
||||
}
|
||||
Write-Host ''
|
||||
Install-LxsWingetPackage -Id 'Git.Git' -Name 'Git for Windows' | Out-Null
|
||||
}
|
||||
|
||||
function Update-LxsClaudeCode {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'UPDATE CLAUDE CODE'
|
||||
Write-Host ''
|
||||
if (-not (Get-LxsClaudeCommand)) {
|
||||
Write-LxsErr 'claude is not installed (or not on your PATH).'
|
||||
return
|
||||
}
|
||||
|
||||
# A native install updates itself; a winget install needs winget. Trying
|
||||
# `claude update` first covers the native case and reports the right thing
|
||||
# for the winget case.
|
||||
Write-LxsInfo 'Asking Claude Code to update itself...'
|
||||
Write-Host ''
|
||||
& claude update
|
||||
Write-Host ''
|
||||
Show-LxsSeparator
|
||||
Write-Host ''
|
||||
if ((Test-LxsWinget) -and (Test-LxsPackageInstalled -Id 'Anthropic.ClaudeCode')) {
|
||||
Write-LxsInfo 'This looks like a winget install; upgrading through winget too...'
|
||||
Write-Host ''
|
||||
& winget upgrade --id Anthropic.ClaudeCode --exact --silent `
|
||||
--accept-package-agreements --accept-source-agreements
|
||||
Write-Host ''
|
||||
Write-Host "$($script:Gray)A winget upgrade can fail while Claude Code is running, because$($script:NC)"
|
||||
Write-Host "$($script:Gray)Windows locks the executable. Close it and retry if that happens.$($script:NC)"
|
||||
}
|
||||
}
|
||||
|
||||
function Show-LxsClaudeMenu {
|
||||
while ($true) {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'CLAUDE CODE'
|
||||
Write-Host ''
|
||||
Show-LxsMenuItem '1' 'Show status' 'version + claude doctor'
|
||||
Show-LxsMenuItem '2' 'Install (native)' 'auto-updating, recommended'
|
||||
Show-LxsMenuItem '3' 'Install (winget)' 'manual updates'
|
||||
Show-LxsMenuItem '4' 'Install Git for Windows' 'enables the Bash tool'
|
||||
Show-LxsMenuItem '5' 'Update Claude Code'
|
||||
Show-LxsMenuItem '0' 'Back' '' -Exit
|
||||
Write-Host ''
|
||||
Show-LxsBoxBottom
|
||||
Write-Host ''
|
||||
Write-Host "$($script:Gray) Claude Code needs a Pro, Max, Team, Enterprise or Console account.$($script:NC)"
|
||||
Write-Host ''
|
||||
$choice = Read-LxsChoice
|
||||
Write-Host ''
|
||||
|
||||
switch ($choice) {
|
||||
'1' { Show-LxsClaudeStatus; Read-LxsEnter }
|
||||
'2' { Install-LxsClaudeNative; Read-LxsEnter }
|
||||
'3' { Install-LxsClaudeWinget; Read-LxsEnter }
|
||||
'4' { Install-LxsGitForWindows; Read-LxsEnter }
|
||||
'5' { Update-LxsClaudeCode; Read-LxsEnter }
|
||||
'0' { return }
|
||||
default { Write-LxsErr 'Invalid protocol. Select 0-5.'; Start-Sleep -Seconds 1 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Show-LxsClaudeMenu
|
||||
exit 75
|
||||
@@ -0,0 +1,151 @@
|
||||
<#
|
||||
LXS - Containers and virtualization (Windows)
|
||||
Description: WSL 2, Hyper-V, Docker Desktop and VirtualBox.
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
#>
|
||||
|
||||
# Load LXS common library (colors, UI helpers, spinner, loggers, guards).
|
||||
# Prefers the sibling ..\lib\common.ps1 (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone.
|
||||
$LxsRawBase = if ($env:LXS_RAW_BASE) { $env:LXS_RAW_BASE } else { 'https://git.hyko.cx/hykocx/lxs/raw/branch/main' }
|
||||
if (-not $env:LXS_RAW_PLATFORM_BASE) { $env:LXS_RAW_PLATFORM_BASE = "$LxsRawBase/windows" }
|
||||
$LxsLibPath = if ($PSScriptRoot) { Join-Path $PSScriptRoot '..\lib\common.ps1' } else { $null }
|
||||
if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
. $LxsLibPath
|
||||
} else {
|
||||
try {
|
||||
$LxsLibSource = Invoke-RestMethod -Uri "$env:LXS_RAW_PLATFORM_BASE/lib/common.ps1" -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
}
|
||||
|
||||
$env:LXS_LOG_FILE = Join-Path (Get-LxsTempDir) 'lxs_containers.log'
|
||||
|
||||
if (-not (Assert-LxsWindows)) { exit 1 }
|
||||
|
||||
$LxsContainerPackages = @(
|
||||
@{ Name = 'Docker Desktop'; Id = 'Docker.DockerDesktop' }
|
||||
@{ Name = 'VirtualBox'; Id = 'Oracle.VirtualBox' }
|
||||
)
|
||||
|
||||
function Show-LxsVirtualizationStatus {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'VIRTUALIZATION STATUS'
|
||||
Write-Host ''
|
||||
|
||||
try {
|
||||
$cs = Get-CimInstance Win32_ComputerSystem -ErrorAction Stop
|
||||
if ($cs.HypervisorPresent) {
|
||||
Write-LxsOk 'A hypervisor is running (Hyper-V, WSL 2 or another VMM)'
|
||||
} else {
|
||||
$proc = Get-CimInstance Win32_Processor -ErrorAction Stop | Select-Object -First 1
|
||||
if ($proc.VirtualizationFirmwareEnabled) {
|
||||
Write-LxsOk 'Hardware virtualization is enabled in firmware, no hypervisor running'
|
||||
} else {
|
||||
Write-LxsWarn 'Hardware virtualization looks DISABLED in the BIOS/UEFI.'
|
||||
Write-Host "$($script:Gray) Enable Intel VT-x / AMD-V there, or Docker and WSL 2 will not start.$($script:NC)"
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
Write-LxsWarn 'Could not read the virtualization state.'
|
||||
}
|
||||
|
||||
Write-Host ''
|
||||
foreach ($feature in @('Microsoft-Windows-Subsystem-Linux', 'VirtualMachinePlatform', 'Microsoft-Hyper-V-All')) {
|
||||
try {
|
||||
$f = Get-WindowsOptionalFeature -Online -FeatureName $feature -ErrorAction Stop
|
||||
$color = if ($f.State -eq 'Enabled') { $script:Cyan } else { $script:Gray }
|
||||
Write-Host (" {0,-38} $color{1}$($script:NC)" -f $feature, $f.State)
|
||||
} catch {
|
||||
Write-Host (" {0,-38} $($script:Gray)not available on this edition$($script:NC)" -f $feature)
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host ''
|
||||
if (Get-Command wsl.exe -ErrorAction SilentlyContinue) {
|
||||
Write-Host "$($script:Cyan)Installed WSL distributions:$($script:NC)"
|
||||
& wsl.exe --list --verbose 2>&1 | Out-String | Write-Host
|
||||
}
|
||||
}
|
||||
|
||||
function Install-LxsWsl {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'WSL 2'
|
||||
Write-Host ''
|
||||
Write-Host 'Enables WSL and the Virtual Machine Platform, then installs the'
|
||||
Write-Host "default distribution. A $($script:Bold)reboot is required$($script:NC) afterwards."
|
||||
Write-Host ''
|
||||
if (-not (Confirm-LxsAction -Question 'Install WSL 2?')) { Write-LxsInfo 'Cancelled.'; return }
|
||||
if (-not (Test-LxsAdmin)) {
|
||||
Write-LxsErr 'Installing WSL requires administrator rights.'
|
||||
return
|
||||
}
|
||||
Write-Host ''
|
||||
& wsl.exe --install
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-LxsOk 'WSL install started — reboot to finish'
|
||||
} else {
|
||||
Write-LxsWarn "wsl --install exited with code $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
function Enable-LxsHyperV {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'HYPER-V'
|
||||
Write-Host ''
|
||||
Write-Host 'Enables the Hyper-V platform and management tools.'
|
||||
Write-Host ''
|
||||
Write-Host "$($script:Gray)Hyper-V is only on Pro, Enterprise and Education editions. Turning it$($script:NC)"
|
||||
Write-Host "$($script:Gray)on takes over the hardware virtualization extensions, which can stop$($script:NC)"
|
||||
Write-Host "$($script:Gray)VirtualBox and VMware from running their own VMs.$($script:NC)"
|
||||
Write-Host ''
|
||||
if (-not (Confirm-LxsAction -Question 'Enable Hyper-V?')) { Write-LxsInfo 'Cancelled.'; return }
|
||||
if (-not (Test-LxsAdmin)) {
|
||||
Write-LxsErr 'Enabling Hyper-V requires administrator rights.'
|
||||
return
|
||||
}
|
||||
Write-Host ''
|
||||
try {
|
||||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -All -NoRestart -ErrorAction Stop | Out-Null
|
||||
Write-LxsOk 'Hyper-V enabled — reboot to finish'
|
||||
} catch {
|
||||
Write-LxsErr "Could not enable Hyper-V: $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
|
||||
function Show-LxsContainersMenu {
|
||||
while ($true) {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'CONTAINERS & VM'
|
||||
Write-Host ''
|
||||
Show-LxsMenuItem '1' 'Show virtualization status'
|
||||
Show-LxsMenuItem '2' 'Install WSL 2' 'needs admin + reboot'
|
||||
Show-LxsMenuItem '3' 'Enable Hyper-V' 'needs admin + reboot'
|
||||
Show-LxsMenuItem '4' 'Install Docker / VirtualBox'
|
||||
Show-LxsMenuItem '0' 'Back' '' -Exit
|
||||
Write-Host ''
|
||||
Show-LxsBoxBottom
|
||||
Write-Host ''
|
||||
$choice = Read-LxsChoice
|
||||
Write-Host ''
|
||||
|
||||
switch ($choice) {
|
||||
'1' { Show-LxsVirtualizationStatus; Read-LxsEnter }
|
||||
'2' { Install-LxsWsl; Read-LxsEnter }
|
||||
'3' { Enable-LxsHyperV; Read-LxsEnter }
|
||||
'4' {
|
||||
Invoke-LxsPackageMenu -Title 'CONTAINERS' -Packages $LxsContainerPackages `
|
||||
-Note 'Docker Desktop needs WSL 2 or Hyper-V enabled first.' | Out-Null
|
||||
Read-LxsEnter
|
||||
}
|
||||
'0' { return }
|
||||
default { Write-LxsErr 'Invalid protocol. Select 0-4.'; Start-Sleep -Seconds 1 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Show-LxsContainersMenu
|
||||
exit 75
|
||||
@@ -0,0 +1,93 @@
|
||||
<#
|
||||
LXS - Dev Pack (Windows)
|
||||
Description: The usual development toolchain, installed through winget.
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
#>
|
||||
|
||||
# Load LXS common library (colors, UI helpers, spinner, loggers, guards).
|
||||
# Prefers the sibling ..\lib\common.ps1 (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone.
|
||||
$LxsRawBase = if ($env:LXS_RAW_BASE) { $env:LXS_RAW_BASE } else { 'https://git.hyko.cx/hykocx/lxs/raw/branch/main' }
|
||||
if (-not $env:LXS_RAW_PLATFORM_BASE) { $env:LXS_RAW_PLATFORM_BASE = "$LxsRawBase/windows" }
|
||||
$LxsLibPath = if ($PSScriptRoot) { Join-Path $PSScriptRoot '..\lib\common.ps1' } else { $null }
|
||||
if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
. $LxsLibPath
|
||||
} else {
|
||||
try {
|
||||
$LxsLibSource = Invoke-RestMethod -Uri "$env:LXS_RAW_PLATFORM_BASE/lib/common.ps1" -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
}
|
||||
|
||||
$env:LXS_LOG_FILE = Join-Path (Get-LxsTempDir) 'lxs_dev_pack.log'
|
||||
|
||||
if (-not (Assert-LxsWindows)) { exit 1 }
|
||||
|
||||
$LxsDevPackages = @(
|
||||
@{ Name = 'Git'; Id = 'Git.Git' }
|
||||
@{ Name = 'VS Code'; Id = 'Microsoft.VisualStudioCode' }
|
||||
@{ Name = 'Node.js LTS'; Id = 'OpenJS.NodeJS.LTS' }
|
||||
@{ Name = 'Python 3'; Id = 'Python.Python.3.12' }
|
||||
@{ Name = 'PowerShell 7'; Id = 'Microsoft.PowerShell' }
|
||||
@{ Name = 'Windows Terminal'; Id = 'Microsoft.WindowsTerminal' }
|
||||
)
|
||||
|
||||
function Enable-LxsWsl {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'WSL 2'
|
||||
Write-Host ''
|
||||
Write-Host 'Installs the Windows Subsystem for Linux (WSL 2) and the default'
|
||||
Write-Host 'Ubuntu distribution. Enables the Virtual Machine Platform feature,'
|
||||
Write-Host "so a $($script:Bold)reboot is required$($script:NC) before WSL works."
|
||||
Write-Host ''
|
||||
if (-not (Confirm-LxsAction -Question 'Install WSL 2?')) {
|
||||
Write-LxsInfo 'Cancelled.'
|
||||
return
|
||||
}
|
||||
if (-not (Test-LxsAdmin)) {
|
||||
Write-LxsErr 'Installing WSL requires administrator rights.'
|
||||
Write-Host "$($script:Gray) Re-run lxs from an elevated terminal.$($script:NC)"
|
||||
return
|
||||
}
|
||||
Write-Host ''
|
||||
& wsl.exe --install
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-LxsOk 'WSL install started'
|
||||
Write-LxsWarn 'Reboot to finish, then run: wsl --install -d Ubuntu'
|
||||
} else {
|
||||
Write-LxsWarn "wsl --install exited with code $LASTEXITCODE"
|
||||
}
|
||||
}
|
||||
|
||||
function Show-LxsDevMenu {
|
||||
while ($true) {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'DEV PACK'
|
||||
Write-Host ''
|
||||
Show-LxsMenuItem '1' 'Install dev tools' 'pick from the list'
|
||||
Show-LxsMenuItem '2' 'Install WSL 2' 'needs admin + reboot'
|
||||
Show-LxsMenuItem '0' 'Back' '' -Exit
|
||||
Write-Host ''
|
||||
Show-LxsBoxBottom
|
||||
Write-Host ''
|
||||
$choice = Read-LxsChoice
|
||||
Write-Host ''
|
||||
|
||||
switch ($choice) {
|
||||
'1' {
|
||||
Invoke-LxsPackageMenu -Title 'DEV PACK' -Packages $LxsDevPackages `
|
||||
-Note 'Everything here installs per-machine and lands on your PATH.' | Out-Null
|
||||
Read-LxsEnter
|
||||
}
|
||||
'2' { Enable-LxsWsl; Read-LxsEnter }
|
||||
'0' { return }
|
||||
default { Write-LxsErr 'Invalid protocol. Select 0-2.'; Start-Sleep -Seconds 1 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Show-LxsDevMenu
|
||||
exit 75
|
||||
@@ -0,0 +1,64 @@
|
||||
<#
|
||||
LXS - Apps index (Windows)
|
||||
Description: Interactive menu listing the installers in windows\apps
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
#>
|
||||
|
||||
# Load LXS common library (colors, UI helpers, spinner, loggers, guards).
|
||||
# Prefers the sibling ..\lib\common.ps1 (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone.
|
||||
$LxsRawBase = if ($env:LXS_RAW_BASE) { $env:LXS_RAW_BASE } else { 'https://git.hyko.cx/hykocx/lxs/raw/branch/main' }
|
||||
if (-not $env:LXS_RAW_PLATFORM_BASE) { $env:LXS_RAW_PLATFORM_BASE = "$LxsRawBase/windows" }
|
||||
$LxsLibPath = if ($PSScriptRoot) { Join-Path $PSScriptRoot '..\lib\common.ps1' } else { $null }
|
||||
if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
. $LxsLibPath
|
||||
} else {
|
||||
try {
|
||||
$LxsLibSource = Invoke-RestMethod -Uri "$env:LXS_RAW_PLATFORM_BASE/lib/common.ps1" -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
}
|
||||
|
||||
function Show-LxsAppsMenu {
|
||||
while ($true) {
|
||||
Clear-Host
|
||||
Show-LxsBoxTop -Title 'APPLICATIONS' -Right 'APP_REPOSITORY'
|
||||
Write-Host ''
|
||||
Show-LxsMenuItem '01' 'Dev Pack' 'git, vscode, node, python'
|
||||
Show-LxsMenuItem '02' 'Utilities' '7zip, powertoys, sysinternals'
|
||||
Show-LxsMenuItem '03' 'Browsers & Media' 'librewolf, firefox, vlc, obs'
|
||||
Show-LxsMenuItem '04' 'Containers & VM' 'wsl2, docker, hyper-v'
|
||||
Show-LxsMenuItem '05' 'Claude Code' 'anthropic cli'
|
||||
Show-LxsMenuItem '00' 'BACK' '' -Exit
|
||||
Write-Host ''
|
||||
Show-LxsBoxBottom
|
||||
Write-Host ''
|
||||
$choice = Read-LxsChoice
|
||||
|
||||
$script = switch -Regex ($choice) {
|
||||
'^0?1$' { 'apps\dev-pack.ps1' }
|
||||
'^0?2$' { 'apps\utilities.ps1' }
|
||||
'^0?3$' { 'apps\browsers-media.ps1' }
|
||||
'^0?4$' { 'apps\containers.ps1' }
|
||||
'^0?5$' { 'apps\claude-code.ps1' }
|
||||
'^0?0$' { 'BACK' }
|
||||
default { $null }
|
||||
}
|
||||
|
||||
if ($script -eq 'BACK') { return }
|
||||
if (-not $script) {
|
||||
Write-LxsErr 'Invalid protocol. Select 0-5.'
|
||||
Start-Sleep -Seconds 1
|
||||
continue
|
||||
}
|
||||
|
||||
$code = Invoke-LxsSibling -RelativePath $script -SelfDirectory $PSScriptRoot
|
||||
if ($code -ne 75) { Read-LxsEnter }
|
||||
}
|
||||
}
|
||||
|
||||
Show-LxsAppsMenu
|
||||
exit 75
|
||||
@@ -0,0 +1,40 @@
|
||||
<#
|
||||
LXS - Utilities (Windows)
|
||||
Description: Everyday utilities installed through winget.
|
||||
Repo: https://git.hyko.cx/hykocx/lxs
|
||||
#>
|
||||
|
||||
# Load LXS common library (colors, UI helpers, spinner, loggers, guards).
|
||||
# Prefers the sibling ..\lib\common.ps1 (repo checkout or installed layout) and
|
||||
# only hits the network when this script is run standalone.
|
||||
$LxsRawBase = if ($env:LXS_RAW_BASE) { $env:LXS_RAW_BASE } else { 'https://git.hyko.cx/hykocx/lxs/raw/branch/main' }
|
||||
if (-not $env:LXS_RAW_PLATFORM_BASE) { $env:LXS_RAW_PLATFORM_BASE = "$LxsRawBase/windows" }
|
||||
$LxsLibPath = if ($PSScriptRoot) { Join-Path $PSScriptRoot '..\lib\common.ps1' } else { $null }
|
||||
if ($LxsLibPath -and (Test-Path $LxsLibPath)) {
|
||||
. $LxsLibPath
|
||||
} else {
|
||||
try {
|
||||
$LxsLibSource = Invoke-RestMethod -Uri "$env:LXS_RAW_PLATFORM_BASE/lib/common.ps1" -UseBasicParsing -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Error 'Failed to fetch lib/common.ps1'
|
||||
exit 1
|
||||
}
|
||||
. ([scriptblock]::Create($LxsLibSource))
|
||||
}
|
||||
|
||||
$env:LXS_LOG_FILE = Join-Path (Get-LxsTempDir) 'lxs_utilities.log'
|
||||
|
||||
if (-not (Assert-LxsWindows)) { exit 1 }
|
||||
|
||||
$LxsUtilityPackages = @(
|
||||
@{ Name = '7-Zip'; Id = '7zip.7zip' }
|
||||
@{ Name = 'Notepad++'; Id = 'Notepad++.Notepad++' }
|
||||
@{ Name = 'PowerToys'; Id = 'Microsoft.PowerToys' }
|
||||
@{ Name = 'Sysinternals'; Id = 'Microsoft.Sysinternals' }
|
||||
@{ Name = 'Everything'; Id = 'voidtools.Everything' }
|
||||
@{ Name = 'ShareX'; Id = 'ShareX.ShareX' }
|
||||
)
|
||||
|
||||
Invoke-LxsPackageMenu -Title 'UTILITIES' -Packages $LxsUtilityPackages `
|
||||
-Note 'Search, screenshots, archives and the Sysinternals suite.' | Out-Null
|
||||
exit 0
|
||||
Reference in New Issue
Block a user