diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 66e5a48b10..e77f7bd409 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -433,7 +433,7 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cli" -version = "3.0.0-beta.20" +version = "3.0.0-beta.21" dependencies = [ "anyhow", "clap", @@ -662,7 +662,7 @@ dependencies = [ [[package]] name = "daemon" -version = "3.0.0-beta.20" +version = "3.0.0-beta.21" dependencies = [ "anyhow", "axum", @@ -3117,7 +3117,7 @@ dependencies = [ [[package]] name = "spicetify" -version = "3.0.0-beta.20" +version = "3.0.0-beta.21" dependencies = [ "aho-corasick", "anyhow", @@ -3717,7 +3717,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tui" -version = "3.0.0-beta.20" +version = "3.0.0-beta.21" dependencies = [ "anyhow", "crossterm", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index f6811bb4f7..c94518c266 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -3,12 +3,12 @@ members = ["crates/spicetify", "crates/cli", "crates/tui", "crates/daemon"] resolver = "2" [workspace.package] -version = "3.0.0-beta.20" +version = "3.0.0-beta.21" edition = "2024" rust-version = "1.95" -repository = "https://github.com/veryboringhwl/app" +repository = "https://github.com/spicetify/cli" homepage = "https://spicetify.app" -authors = ["veryboringhwl"] +authors = ["afonsojramos", "veryboringhwl", "rxri"] license = "MIT" publish = false diff --git a/rust/build/install.ps1 b/rust/build/install.ps1 deleted file mode 100644 index ed81414c00..0000000000 --- a/rust/build/install.ps1 +++ /dev/null @@ -1,77 +0,0 @@ -$ErrorActionPreference = 'Stop' - -$ProcessorArch = (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment').PROCESSOR_ARCHITECTURE -if ($ProcessorArch -ne 'AMD64' -and $ProcessorArch -ne 'ARM64') { - Write-Error "Spicetify is only available for x64 and ARM64 Windows" - exit 1 -} -$Arch = if ($ProcessorArch -eq 'ARM64') { 'aarch64' } else { 'x64' } - -$BinDir = "$env:LOCALAPPDATA\Spicetify\bin" - -if (-not (Test-Path $BinDir)) { - New-Item -ItemType Directory -Path $BinDir -Force | Out-Null -} - -try { - $releases = Invoke-RestMethod -Uri "https://api.github.com/repos/veryboringhwl/app/releases/latest" - $Version = $releases.tag_name -replace '^v', '' -} catch { - Write-Error "Could not determine latest version" - exit 1 -} - -Write-Output "Downloading Spicetify ${Version}..." - -$Archive = "spicetify-${Version}-windows-${Arch}.zip" -$Uri = "https://github.com/veryboringhwl/app/releases/download/v${Version}/${Archive}" -$ZipPath = "${BinDir}\spicetify.zip" - -curl.exe --ssl-revoke-best-effort -L --progress-bar -o $ZipPath $Uri -if ($LASTEXITCODE -ne 0) { - try { - Invoke-WebRequest -Uri $Uri -OutFile $ZipPath - } catch { - Write-Error "Failed to download ${Uri}" - exit 1 - } -} - -$prev = $ProgressPreference -$ProgressPreference = 'SilentlyContinue' -Expand-Archive -Path $ZipPath -DestinationPath $BinDir -Force -$ProgressPreference = $prev -Remove-Item $ZipPath - -$User = [System.EnvironmentVariableTarget]::User -$Path = [System.Environment]::GetEnvironmentVariable('Path', $User) -if (-not (";${Path};".ToLower() -like "*;${BinDir};*".ToLower())) { - [System.Environment]::SetEnvironmentVariable('Path', "${Path};${BinDir}", $User) -} -$env:Path = "${BinDir};" + $env:Path - -Write-Output "Spicetify ${Version} installed to ${BinDir}" - -$Spicetify = "${BinDir}\spicetify.exe" - -Write-Output "" -Write-Output "Initializing Spicetify..." -& $Spicetify init --yes -& $Spicetify apply - -Write-Output "" -Write-Output "Creating Start Menu shortcut..." - -$Programs = "$env:APPDATA\Microsoft\Windows\Start Menu\Programs" -if (-not (Test-Path $Programs)) { - New-Item -ItemType Directory -Path $Programs -Force | Out-Null -} -$WScriptShell = New-Object -ComObject WScript.Shell -$Shortcut = $WScriptShell.CreateShortcut("$Programs\Spicetify.lnk") -$Shortcut.TargetPath = "$BinDir\spicetify.exe" -$Shortcut.WorkingDirectory = "$BinDir" -$Shortcut.IconLocation = "$BinDir\spicetify.exe" -$Shortcut.Save() - -Write-Output "" -Write-Output "Done. Run 'spicetify' to get started" diff --git a/rust/build/install.sh b/rust/build/install.sh deleted file mode 100644 index def7ab34b8..0000000000 --- a/rust/build/install.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/usr/bin/env sh -set -eu - -main() { - if ! command -v curl >/dev/null 2>&1; then - echo "Error: curl is required to install Spicetify" >&2 - exit 1 - fi - - case $(uname -sm) in - "Darwin x86_64") os="macos"; arch="x86_64" ;; - "Darwin arm64") os="macos"; arch="aarch64" ;; - "Linux x86_64") os="linux"; arch="x86_64" ;; - *) echo "Error: unsupported platform $(uname -sm)" >&2; exit 1 ;; - esac - - version=$(curl -fsSL "https://api.github.com/repos/veryboringhwl/app/releases/latest" 2>/dev/null \ - | grep '"tag_name"' | sed -E 's/.*"v([^"]+)".*/\1/') - if [ -z "$version" ]; then - echo "Error: could not determine latest version" >&2 - exit 1 - fi - - case $os in - macos) install_macos ;; - linux) install_linux ;; - esac - - export PATH="${bin_dir}:${PATH}" - - echo "Spicetify ${version} installed${install_note}" - - echo "" - echo "Initializing Spicetify..." - "${bin_dir}/spicetify" init --yes - "${bin_dir}/spicetify" apply - - echo "" - echo "Done. Run 'spicetify' to get started" -} - -install_macos() { - archive="spicetify-${version}-macos-${arch}.dmg" - uri="https://github.com/veryboringhwl/app/releases/download/v${version}/${archive}" - - echo "Downloading Spicetify ${version}..." - - temp=$(mktemp -d) - curl --fail --location --progress-bar --output "${temp}/${archive}" "$uri" - - hdiutil attach -quiet "${temp}/${archive}" -mountpoint "${temp}/mount" - cleanup() { - hdiutil detach -quiet "${temp}/mount" 2>/dev/null || true - rm -rf "$temp" - } - trap cleanup EXIT - - mkdir -p "$HOME/Applications" - ditto "${temp}/mount/Spicetify.app" "$HOME/Applications/Spicetify.app" - - cleanup - trap - EXIT - - bin_dir="$HOME/Applications/Spicetify.app/Contents/MacOS" - - install_note=" to ~/Applications/Spicetify.app" - - ensure_in_path -} - -install_linux() { - bin_dir="$HOME/.local/bin" - icon_dir="$HOME/.local/share/icons" - mkdir -p "$bin_dir" "$icon_dir" - - archive="spicetify-${version}-${arch}-linux.tar.zst" - uri="https://github.com/veryboringhwl/app/releases/download/v${version}/${archive}" - - echo "Downloading Spicetify ${version}..." - - temp=$(mktemp -d) - trap 'rm -rf "$temp"' EXIT - curl --fail --location --progress-bar --output "${temp}/${archive}" "$uri" - - if ! tar --zstd -xf "${temp}/${archive}" -C "$bin_dir" 2>/dev/null; then - if command -v zstd >/dev/null 2>&1; then - zstd -d "${temp}/${archive}" -o "${temp}/spicetify.tar" - tar -xf "${temp}/spicetify.tar" -C "$bin_dir" - else - echo "Error: tar does not support zstd, and zstd command not found" >&2 - echo "Install zstd and try again" >&2 - exit 1 - fi - fi - - chmod +x "${bin_dir}/spicetify" - chmod +x "${bin_dir}/spicetify-daemon" - - # Install custom icon if available - icon_path="utilities-terminal" - if [ -f "./images/spicetify.png" ]; then - cp "./images/spicetify.png" "${icon_dir}/spicetify.png" - icon_path="${icon_dir}/spicetify.png" - elif [ -f "${temp}/images/spicetify.png" ]; then - cp "${temp}/images/spicetify.png" "${icon_dir}/spicetify.png" - icon_path="${icon_dir}/spicetify.png" - fi - - mkdir -p "$HOME/.local/share/applications" - cat > "$HOME/.local/share/applications/spicetify.desktop" << DESKTOP_EOF -[Desktop Entry] -Type=Application -Name=Spicetify -Comment=Customize your Spotify experience -GenericName=Spotify Customization Tool -Exec=${bin_dir}/spicetify -Icon=${icon_path} -Terminal=true -Categories=Audio;Music;Utility; -Keywords=spotify;customize;theme;plugin; -StartupNotify=false -StartupWMClass=spicetify -DESKTOP_EOF - - install_note=" to ${bin_dir}" - - ensure_in_path -} - -ensure_in_path() { - if echo "$PATH" | tr ':' '\n' | grep -qF "$bin_dir"; then - return - fi - - export_line="export PATH=\"${bin_dir}:\$PATH\" # spicetify" - - case "${SHELL##*/}" in - fish) - if command -v fish >/dev/null 2>&1; then - fish -c "fish_add_path -U ${bin_dir}" 2>/dev/null || true - fi - ;; - zsh) - rc="$HOME/.zshrc" - grep -qF "${bin_dir}" "$rc" 2>/dev/null \ - || echo "$export_line" >> "$rc" 2>/dev/null \ - || echo "Add this to your shell config: ${export_line}" - ;; - *) - saved=false - for rc in "$HOME/.bashrc" "$HOME/.bash_profile" "$HOME/.profile"; do - if grep -qF "${bin_dir}" "$rc" 2>/dev/null; then - return - fi - if echo "$export_line" >> "$rc" 2>/dev/null; then - saved=true - break - fi - done - if ! $saved; then - echo "Add this to your shell config: ${export_line}" - fi - ;; - esac -} - -main "$@"