mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-24 12:35:05 +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
|
$PSMinVersion = 3
|
||||||
|
|
||||||
if ($v) {
|
if ($v) {
|
||||||
$version = $v
|
$version = $v
|
||||||
}
|
}
|
||||||
|
|
||||||
# Helper functions for pretty terminal output.
|
# Helper functions for pretty terminal output.
|
||||||
|
|
@ -32,8 +32,8 @@ if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
|
||||||
|
|
||||||
$checkSpice = Get-Command spicetify -ErrorAction Silent
|
$checkSpice = Get-Command spicetify -ErrorAction Silent
|
||||||
if ($null -eq $checkSpice) {
|
if ($null -eq $checkSpice) {
|
||||||
Write-Host -ForegroundColor Red "Spicetify not found"
|
Write-Host -ForegroundColor Red "Spicetify not found"
|
||||||
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/khanhas/spicetify-cli/master/install.ps1" | Invoke-Expression
|
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/khanhas/spicetify-cli/master/install.ps1" | Invoke-Expression
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $version) {
|
if (-not $version) {
|
||||||
|
|
@ -95,26 +95,34 @@ if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
|
||||||
spicetify config current_theme DribbblishDynamic
|
spicetify config current_theme DribbblishDynamic
|
||||||
spicetify config color_scheme base
|
spicetify config color_scheme base
|
||||||
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
|
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
|
||||||
spicetify apply
|
|
||||||
Write-Done
|
Write-Done
|
||||||
|
|
||||||
# Add patch
|
# Add patch
|
||||||
Write-Part "PATCHING "; Write-Emphasized "config-xpui.ini"
|
Write-Part "PATCHING "; Write-Emphasized "config-xpui.ini"
|
||||||
$configFile = Get-Content "$spicePath\config-xpui.ini"
|
$configFile = Get-Content "$spicePath\config-xpui.ini"
|
||||||
if (-not ($configFile -match "xpui.js_find_8008")) {
|
if (-not ($configFile -match "xpui.js_find_8008")) {
|
||||||
$rep = @"
|
$rep = @"
|
||||||
[Patch]
|
[Patch]
|
||||||
xpui.js_find_8008=,(\w+=)32,
|
xpui.js_find_8008=,(\w+=)32,
|
||||||
xpui.js_repl_8008=,`${1}58,
|
xpui.js_repl_8008=,`${1}58,
|
||||||
"@
|
"@
|
||||||
# In case missing Patch section
|
# In case missing Patch section
|
||||||
if (-not ($configFile -match "\[Patch\]")) {
|
if (-not ($configFile -match "\[Patch\]")) {
|
||||||
$configFile += "`n[Patch]`n"
|
$configFile += "`n[Patch]`n"
|
||||||
}
|
}
|
||||||
$configFile = $configFile -replace "\[Patch\]",$rep
|
$configFile = $configFile -replace "\[Patch\]",$rep
|
||||||
Set-Content "$spicePath\config-xpui.ini" $configFile
|
Set-Content "$spicePath\config-xpui.ini" $configFile
|
||||||
}
|
}
|
||||||
Write-Done
|
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 {
|
else {
|
||||||
Write-Part "`nYour Powershell version is less than "; Write-Emphasized "$PSMinVersion";
|
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 current_theme DribbblishDynamic
|
||||||
spicetify config color_scheme base
|
spicetify config color_scheme base
|
||||||
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
|
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
|
||||||
spicetify apply
|
|
||||||
|
|
||||||
echo "PATCHING"
|
echo "PATCHING"
|
||||||
PATCH='[Patch]
|
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
|
perl -i -0777 -pe "s/\[Patch\].*?($|(\r*\n){2})/$PATCH\n\n/s" config-xpui.ini
|
||||||
else
|
else
|
||||||
echo -e "\n$PATCH" >> config-xpui.ini
|
echo -e "\n$PATCH" >> config-xpui.ini
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "APPLYING"
|
||||||
|
spicetify apply
|
||||||
Loading…
Reference in a new issue