mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-19 04:08:53 +00:00
call spicetify apply after patching in install scripts
This commit is contained in:
parent
2a861c9e7c
commit
e948f8d120
2 changed files with 23 additions and 13 deletions
30
install.ps1
30
install.ps1
|
|
@ -7,7 +7,7 @@ param (
|
|||
$PSMinVersion = 3
|
||||
|
||||
if ($v) {
|
||||
$version = $v
|
||||
$version = $v
|
||||
}
|
||||
|
||||
# Helper functions for pretty terminal output.
|
||||
|
|
@ -32,8 +32,8 @@ if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
|
|||
|
||||
$checkSpice = Get-Command spicetify -ErrorAction Silent
|
||||
if ($null -eq $checkSpice) {
|
||||
Write-Host -ForegroundColor Red "Spicetify not found"
|
||||
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/khanhas/spicetify-cli/master/install.ps1" | Invoke-Expression
|
||||
Write-Host -ForegroundColor Red "Spicetify not found"
|
||||
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/khanhas/spicetify-cli/master/install.ps1" | Invoke-Expression
|
||||
}
|
||||
|
||||
if (-not $version) {
|
||||
|
|
@ -95,26 +95,34 @@ if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
|
|||
spicetify config current_theme DribbblishDynamic
|
||||
spicetify config color_scheme base
|
||||
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
|
||||
spicetify apply
|
||||
Write-Done
|
||||
|
||||
# Add patch
|
||||
Write-Part "PATCHING "; Write-Emphasized "config-xpui.ini"
|
||||
$configFile = Get-Content "$spicePath\config-xpui.ini"
|
||||
if (-not ($configFile -match "xpui.js_find_8008")) {
|
||||
$rep = @"
|
||||
$rep = @"
|
||||
[Patch]
|
||||
xpui.js_find_8008=,(\w+=)32,
|
||||
xpui.js_repl_8008=,`${1}58,
|
||||
"@
|
||||
# In case missing Patch section
|
||||
if (-not ($configFile -match "\[Patch\]")) {
|
||||
$configFile += "`n[Patch]`n"
|
||||
}
|
||||
$configFile = $configFile -replace "\[Patch\]",$rep
|
||||
Set-Content "$spicePath\config-xpui.ini" $configFile
|
||||
# In case missing Patch section
|
||||
if (-not ($configFile -match "\[Patch\]")) {
|
||||
$configFile += "`n[Patch]`n"
|
||||
}
|
||||
$configFile = $configFile -replace "\[Patch\]",$rep
|
||||
Set-Content "$spicePath\config-xpui.ini" $configFile
|
||||
}
|
||||
Write-Done
|
||||
|
||||
Write-Part "APPLYING";
|
||||
$backupVer = $configFile -match "^version"
|
||||
$version = ConvertFrom-StringData $backupVer[0]
|
||||
if ($version.version.Length -gt 0) {
|
||||
spicetify apply
|
||||
} else {
|
||||
spicetify backup apply
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Part "`nYour Powershell version is less than "; Write-Emphasized "$PSMinVersion";
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ spicetify config extensions default-dynamic.js- extensions dribbblish.js- extens
|
|||
spicetify config current_theme DribbblishDynamic
|
||||
spicetify config color_scheme base
|
||||
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
|
||||
spicetify apply
|
||||
|
||||
echo "PATCHING"
|
||||
PATCH='[Patch]
|
||||
|
|
@ -65,4 +64,7 @@ if cat config-xpui.ini | grep -o '\[Patch\]'; then
|
|||
perl -i -0777 -pe "s/\[Patch\].*?($|(\r*\n){2})/$PATCH\n\n/s" config-xpui.ini
|
||||
else
|
||||
echo -e "\n$PATCH" >> config-xpui.ini
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "APPLYING"
|
||||
spicetify apply
|
||||
Loading…
Reference in a new issue