-
Notifications
You must be signed in to change notification settings - Fork 2
/
InstallSpicetifyForWindows.ps1
67 lines (55 loc) · 2.8 KB
/
InstallSpicetifyForWindows.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
# Use this command to run the latest version of this script from GitHub:
# iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Aluulu/spicetify-install-script/main/InstallSpicetifyForWindows.ps1'))
$ErrorActionPreference = 'Stop'
$CheckIfSpicetifyIsInstalled = Test-Path -Path "$home\.spicetify"
if ($CheckIfSpicetifyIsInstalled -eq $True) {
Spicetify backup apply
}
else {
function RemoveOldSpicetifyInstall {
Try {
Remove-Item "$home\.spicetify" -Recurse
} Catch {
Write-Host "Unable to remove ~\.spicetify" -foreground Red
Write-host "Error message is as followed: " -foreground Red
$Error[0].exception
$Error[0].Exception.GetType().FullName
}
Try {
Remove-Item "$home\spicetify-cli" -Recurse
} Catch {
Write-Host "Unable to remove ~\spicetify-cli" -foreground Red
Write-host "Error message is as followed: " -foreground Red
$Error[0].exception
$Error[0].Exception.GetType().FullName
}
} # End of function RemoveOldSpicetifyInstall
function DownloadSpicetifyScript {
Try {
# The try function will try to run the following code, and then catch any errors.
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/khanhas/spicetify-cli/master/install.ps1" | Invoke-Expression
}
Catch {
Write-Host "Unable to download and run the script from GitHub" -foreground Red # The catch function will catch any specificied error codes. If left blank it will catch ALL errors.
Write-host "Error message is as followed: " -foreground Red
$Error[0].exception
$Error[0].Exception.GetType().FullName
}
} # End of function DownloadSpicetifyScript
function ConfigureSpotify {
Start-Sleep -Seconds 5 # pauses for 5 seconds to allow Spotify time to load
spicetify config color_scheme purple
# Applies the colour scheme. Change this to be the colour you want to be applied to the Spotify.
# Default is base (Green). Other options include purple, beach-sunset (red), dark (yellow), gruvbox (dark green), nord-dark (light blue), nord-light (light blue with white), and white
Start-Sleep -Seconds 3 # pauses for 3 seconds to allow Spotify time to load
spicetify config extensions fullAppDisplay.js
spicetify config custom_apps reddit
spicetify config custom_apps lyrics-plus
spicetify apply
Write-Output "The script has completed its operation. Please make sure to check that the theme is working, and that applications such as Lyrics and fullAppDisplay are being displayed."
PAUSE
} # End of function ConfigureSpotify
RemoveOldSpicetifyInstall
DownloadSpicetifyScript
ConfigureSpotify
} # End if (if CheckIfSpicetifyIsInstalled) check