Skip to content

Commit

Permalink
Fix small errors and linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
YummyBacon5 authored Nov 19, 2024
1 parent e40f36d commit fb29fd2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It works by finding their config based off of the computer's username.

## Single command to download and run the script

### Updated Powershell command
### Updated PowerShell command

```powershell
iwr "https://github.com/likes-gay/win-config/releases/latest/download/main.ps1" -OutFile main.ps1; .\main.ps1
Expand Down
14 changes: 5 additions & 9 deletions main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ function Reload-Env {
# Code
#---------------------------------------------------------------------------------------------------------------------------------------------

if ((Split-Path -Leaf (pwd)) -ne "likes-gay-config") {
if ((Split-Path -Leaf (Get-Location)) -ne "likes-gay-config") {
mkdir -Force "likes-gay-config"
cd "likes-gay-config"
Set-Location "likes-gay-config"
# $PSCommandPath is the path to the script that is running
if ($null -ne $PSCommandPath) {
Move-Item -Force -Path $PSCommandPath -Destination "."
Expand All @@ -89,7 +89,6 @@ try {
# Parse config file
try {
$configFile = Get-Content ".\config.json" -Raw | ConvertFrom-Json

} catch {
Write-Error "Malformed config file"
Exit
Expand Down Expand Up @@ -117,15 +116,15 @@ scoop bucket add extras
# Set default browser to Chrome
if ($configFile."Default-browser-chrome") {
Invoke-WebRequest "https://raw.githubusercontent.com/likes-gay/win-config/main/default_browser.vbs" -OutFile .\default_browser.vbs
Invoke-Expression "Cscript.exe .\default_browser.vbs //nologo"
Cscript.exe .\default_browser.vbs //nologo
Remove-Item -Path ".\default_browser.vbs"

# Setup edge redirect - https://github.com/rcmaehl/MSEdgeRedirect/wiki/Deploying-MSEdgeRedirect
if ($configFile."Setup-edge-redirect") {
Invoke-WebRequest "https://github.com/rcmaehl/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe" -OutFile .\MSEdgeRedirect.exe
Invoke-WebRequest "https://raw.githubusercontent.com/likes-gay/win-config/main/edge_redirect.ini" -OutFile .\edge_redirect.ini

$process = Start-Process -FilePath ".\MSEdgeRedirect.exe" -ArgumentList "/silentinstall",".\edge_redirect.ini" -PassThru
$process = Start-Process -FilePath ".\MSEdgeRedirect.exe" -ArgumentList "/si",".\edge_redirect.ini" -PassThru
$process.WaitForExit()

Remove-Item -Path ".\edge_redirect.ini"
Expand Down Expand Up @@ -284,8 +283,6 @@ if ($configFile."Accent-colour") {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Accent" -Name "AccentPalette" -Value ([byte[]]$ColorValue)
}

$ColorValue = $configFile."Accent-colour".Split(" ") | ForEach-Object { "0x$_" }

if ($configFile."Accent-colour-on-task-bar") {
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize" -Name "ColorPrevalence" -Value 1
}
Expand All @@ -302,7 +299,6 @@ if ($configFile."Install-UV") {
if ($configFile."Campus-UV-PIP-Fix") {
New-Item -ItemType Directory -Force -Path "$Env:APPDATA\uv"
Invoke-WebRequest "https://github.com/likes-gay/win-config/raw/refs/heads/main/uv.toml" -OutFile "$Env:APPDATA\uv\uv.toml"

}
}

Expand All @@ -323,7 +319,7 @@ if ($configFile."Install-terminal") {
}

if ($configFile."Install-JB-Toolbox") {
winget install -e --id JetBrains.Toolbox
winget install --accept-source-agreements -e --id JetBrains.Toolbox
}

if ($configFile."Install-Spotify") {
Expand Down
2 changes: 1 addition & 1 deletion payload.dd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
REM This is a ducky script to quickly deploy the powershell (in exe format)
REM This is a Ducky script to quickly deploy the PowerShell file and run it
DELAY 100
GUI r
DELAY 100
Expand Down

0 comments on commit fb29fd2

Please sign in to comment.