Skip to content

Commit

Permalink
migration to theme scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ohitstom committed Apr 15, 2023
1 parent b426bff commit 7286581
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 45 deletions.
2 changes: 1 addition & 1 deletion Comfy/comfy.js → Comfy/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
script.setAttribute("type", "text/javascript");
script.setAttribute(
"src",
"https://comfy-themes.github.io/Spicetify/Comfy/comfy.script.js"
"https://comfy-themes.github.io/Spicetify/Comfy/theme.script.js"
);
document.head.appendChild(script);
})();
File renamed without changes.
29 changes: 4 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### ✅ Supported -> Spicetify 2.16.2, Spotify 1.2.6.
### ✅ Supported -> Spicetify 2.17.2, Spotify 1.2.9.

---

Expand Down Expand Up @@ -45,37 +45,16 @@ spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
spicetify apply
```

### Enabling the Comfy extension.

Windows -> **Powershell**:

```powershell
cd "$(spicetify -c | Split-Path)\Themes\Comfy"
Copy-Item comfy.js ..\..\Extensions
spicetify config extensions comfy.js
spicetify apply
```

macOS and Linux -> **Bash**:

```bash
cd "$(dirname "$(spicetify -c)")/Themes/Comfy"
mkdir -p ../../Extensions
cp comfy.js ../../Extensions/.
spicetify config extensions comfy.js
spicetify apply
```

### ⚠️️ Warning

---

The theme automatically updates for users using the version of Spicetify equals or greater than `2.8.2`, however, for the users that don't want to update Spicetify to the newest version:

1. Go [here](https://comfy-themes.github.io/Spicetify/Comfy/comfy.script.js)
1. Go [here](https://comfy-themes.github.io/Spicetify/Comfy/theme.script.js)
2. Copy the whole code (sorry for the flashbang)
3. Go into the Spicetify extension folder
4. Open the `comfy.js` file, paste the code and **save it**
3. Go into the Spicetify/themes/Comfy folder.
4. Open the `theme.js` file, paste the code and **save it**
5. Afterwards, in a terminal, run `spicetify apply`
6. Enjoy !

Expand Down
3 changes: 1 addition & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
Write-Part "DOWNLOADING "; Write-Emphasized $sp_dot_dir
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Comfy-Themes/Spicetify/main/Comfy/color.ini" -UseBasicParsing -OutFile "$sp_dot_dir\Comfy\color.ini"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Comfy-Themes/Spicetify/main/Comfy/user.css" -UseBasicParsing -OutFile "$sp_dot_dir\Comfy\user.css"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Comfy-Themes/Spicetify/main/Comfy/comfy.js" -UseBasicParsing -OutFile "$spicePath\Extensions\comfy.js"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/Comfy-Themes/Spicetify/main/Comfy/theme.js" -UseBasicParsing -OutFile "$sp_dot_dir\Comfy\theme.js"
Write-Done

# Installing.
Write-Part "INSTALLING `r`n"
spicetify config extensions comfy.js
spicetify config current_theme Comfy
spicetify config color_scheme Comfy
Write-Done
Expand Down
6 changes: 2 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ theme_url="https://raw.githubusercontent.com/Comfy-Themes/Spicetify/main/Comfy"
# Setup directories to download to
spice_dir="$(dirname "$(spicetify -c)")"
theme_dir="${spice_dir}/Themes"
ext_dir="${spice_dir}/Extensions"

# Make directories if needed
mkdir -p "${theme_dir}/Comfy"
mkdir -p "${ext_dir}"

# Download latest tagged files into correct director
echo "Downloading Comfy..."
curl --silent --output "${theme_dir}/Comfy/color.ini" "${theme_url}/color.ini"
curl --silent --output "${theme_dir}/Comfy/user.css" "${theme_url}/user.css"
curl --silent --output "${ext_dir}/comfy.js" "${theme_url}/comfy.js"
curl --silent --output "${theme_dir}/Comfy/theme.js" "${theme_url}/theme.js"
echo "Done"

# Apply theme
echo "Applying theme"
spicetify config current_theme Comfy color_scheme Comfy extensions comfy.js
spicetify config current_theme Comfy color_scheme Comfy
spicetify config inject_css 1 replace_colors 1 overwrite_assets 1
spicetify apply

Expand Down
10 changes: 5 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
"readme": "Comfy/README.md",
"usercss": "Comfy/user.css",
"schemes": "Comfy/color.ini",
"include": ["https://comfy-themes.github.io/Spicetify/Comfy/comfy.js"],
"include": ["https://comfy-themes.github.io/Spicetify/Comfy/theme.js"],
"authors": [
{
"name": "NYRI4",
"url": "https://github.com/NYRI4"
},
{
"name": "kyrie25",
"url": "https://github.com/kyrie25"
},
{
"name": "OhItsTom",
"url": "https://github.com/OhItsTom"
},
{
"name": "kyrie25",
"url": "https://github.com/kyrie25"
}
]
}
4 changes: 0 additions & 4 deletions uninstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ if ($PSVersionTable.PSVersion.Major -gt $PSMinVersion) {
Remove-Item -Recurse -Force "$sp_dot_dir\Comfy" -ErrorAction Ignore
Write-Done

Write-Part "REMOVING "; Write-Emphasized "$spicePath\Extensions\comfy.js"
Remove-Item -Force "$spicePath\Extensions\comfy.js" -ErrorAction Ignore
Write-Done
spicetify config current_theme " "
spicetify config color_scheme " "
spicetify config extensions comfy.js-

Write-Part "APPLYING";
$configFile = Get-Content "$spicePath\config-xpui.ini"
Expand Down
5 changes: 1 addition & 4 deletions uninstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

echo "Uninstalling"
spicetify config current_theme "SpicetifyDefault" color_scheme "green-dark" extensions comfy.js-
spicetify config current_theme " " color_scheme " "

echo "Deleting files"
while true; do
Expand All @@ -12,11 +12,8 @@ while true; do
[Yy]*)
spice_dir="$(dirname "$(spicetify -c)")"
theme_dir="${spice_dir}/Themes"
ext_dir="${spice_dir}/Extensions"

rm -rf "${theme_dir}/Comfy"
# Use -f to ignore if missing
rm -f "${ext_dir}/comfy.js"
break
;;
[Nn]*)
Expand Down

0 comments on commit 7286581

Please sign in to comment.