Skip to content

Conversation

@omarschwarten-arch
Copy link

@omarschwarten-arch omarschwarten-arch commented Sep 23, 2025

Adds the StarryNight theme without changig the set up of your spotify.

Summary by CodeRabbit

  • New Features
    • Added an installation script for the StarryNight theme for Spicetify.
    • Validates that Spicetify is installed and exits with a clear error message if not.
    • Automatically locates the themes directory and target installation path.
    • Clones the theme repository when absent; logs when it already exists.
    • Registers the theme with Spicetify without applying it.
    • Displays concise instructions for manually applying the theme afterward.

Adds the StarryNight theme without changig the set up of your spotify.
@coderabbitai
Copy link

coderabbitai bot commented Sep 23, 2025

Walkthrough

Adds a Bash script that checks for Spicetify, locates the themes directory, ensures the StarryNight repo is present (cloning if absent), registers the theme with Spicetify without applying it, and prints manual application instructions.

Changes

Cohort / File(s) Summary
Installer script for StarryNight
.../install_starrynight.sh
New Bash script: validates Spicetify presence, resolves themes path, clones StarryNight if missing, registers the theme (no apply), prints follow-up usage notes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Script as Install Script
  participant Git as Git (StarryNight repo)
  participant Spicetify as Spicetify CLI

  User->>Script: Run installer
  Script->>Spicetify: Check installation/version
  Spicetify-->>Script: Present / Not found
  alt Spicetify not found
    Script-->>User: Exit with error message
  else Spicetify present
    Script->>Script: Determine themes directory & target path
    Script->>Git: Clone StarryNight if not present
    Git-->>Script: Repo cloned or already exists
    Script->>Spicetify: Register StarryNight theme (no apply)
    Script-->>User: Print manual apply instructions
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through scripts beneath starry skies,
A whiskered dev with bright, theme-tinted eyes.
I clone, I check, I register with cheer—
“Apply me later,” whispers in your ear.
Moonlit configs twinkle in the night,
Spicetify hums—StarryNight in sight. 🌙🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Create Edited StarryNight" references the StarryNight theme and therefore relates to the main change (adding the StarryNight installer/registration script), but the wording "Edited" is ambiguous and does not clearly state that a new install/register script was added.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
Edited StarryNight (4)

10-11: Improve path parsing robustness.

The current approach using sed to extract the themes directory is fragile and may fail if the config path format changes or contains unexpected characters.

Apply this diff for more robust path handling:

-THEME_DIR="$(spicetify -c | sed 's/config.ini$/Themes/')"
-STAR_NIGHT_DIR="${THEME_DIR}/StarryNight"
+CONFIG_PATH="$(spicetify -c)"
+if [[ -z "$CONFIG_PATH" || ! -f "$CONFIG_PATH" ]]; then
+    echo "Error: Could not locate Spicetify config file"
+    exit 1
+fi
+THEME_DIR="$(dirname "$CONFIG_PATH")/Themes"
+STAR_NIGHT_DIR="${THEME_DIR}/StarryNight"

10-11: Ensure themes directory exists before operations.

The script assumes the Themes directory exists but doesn't verify or create it, which could cause failures.

Add this code after determining the THEME_DIR but before the git operations:

# Ensure the themes directory exists
if [[ ! -d "$THEME_DIR" ]]; then
    if ! mkdir -p "$THEME_DIR"; then
        echo "Error: Could not create themes directory at $THEME_DIR"
        exit 1
    fi
    echo "Created themes directory at $THEME_DIR"
fi

Also applies to: 21-21


1-25: Consider adding script metadata and usage instructions.

The script lacks documentation about its purpose, usage, and requirements.

Consider adding a header comment block:

#!/bin/bash
#
# StarryNight Theme Installer for Spicetify
# 
# Description: Downloads and registers the StarryNight theme for Spicetify
#              without applying it, preserving current setup.
# 
# Requirements: 
#   - Spicetify must be installed and configured
#   - Git must be available
#   - Internet connection for theme download
#
# Usage: ./install-starrynight.sh
#

16-16: Replace third‑party clone with canonical spicetify-themes or confirm MIT license

StarryNight is included in spicetify/spicetify-themes (MIT); either update the clone to the canonical spicetify/spicetify-themes repo or verify b-chen00/StarryNight is the same code and explicitly MIT-licensed before keeping the current third‑party URL.

Location: Edited StarryNight — line 16 (git clone https://github.com/b-chen00/StarryNight.git)

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 726097a and aa79054.

📒 Files selected for processing (1)
  • Edited StarryNight (1 hunks)

@@ -0,0 +1,24 @@
#!/bin/bash
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add proper file extension and improve filename.

The filename "Edited StarryNight" lacks a proper extension and contains a space, which can cause issues in shell environments and version control systems.

Consider renaming to something like:

install-starrynight.sh

or

setup_starrynight_theme.sh
🤖 Prompt for AI Agents
In Edited StarryNight around lines 1 to 1, the filename contains a space and no
extension which can break shells and tooling; rename the file to a safe,
descriptive name with a .sh extension (for example install-starrynight.sh or
setup_starrynight_theme.sh), update any references to the old filename in
scripts/CI/docs, and ensure the file has executable permissions (chmod +x) so
the existing shebang works as expected.

Comment on lines +13 to +18
if [ -d "$STAR_NIGHT_DIR" ]; then
echo "StarryNight theme already exists at $STAR_NIGHT_DIR"
else
git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"
echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add error handling for git operations.

The script doesn't handle potential git clone failures, which could leave the installation in an inconsistent state.

Apply this diff to add proper error handling:

 if [ -d "$STAR_NIGHT_DIR" ]; then
     echo "StarryNight theme already exists at $STAR_NIGHT_DIR"
 else
-    git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"
-    echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
+    if git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"; then
+        echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
+    else
+        echo "Error: Failed to download StarryNight theme"
+        exit 1
+    fi
 fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [ -d "$STAR_NIGHT_DIR" ]; then
echo "StarryNight theme already exists at $STAR_NIGHT_DIR"
else
git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"
echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
fi
if [ -d "$STAR_NIGHT_DIR" ]; then
echo "StarryNight theme already exists at $STAR_NIGHT_DIR"
else
if git clone https://github.com/b-chen00/StarryNight.git "$STAR_NIGHT_DIR"; then
echo "StarryNight theme downloaded to $STAR_NIGHT_DIR"
else
echo "Error: Failed to download StarryNight theme"
exit 1
fi
fi

fi

# Register theme in Spicetify (but do not apply)
spicetify config current_theme StarryNight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add error handling for spicetify configuration.

The script doesn't verify if the spicetify config command succeeds, which could lead to silent failures.

Apply this diff to add error checking:

-spicetify config current_theme StarryNight
+if ! spicetify config current_theme StarryNight; then
+    echo "Error: Failed to register StarryNight theme with Spicetify"
+    exit 1
+fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
spicetify config current_theme StarryNight
if ! spicetify config current_theme StarryNight; then
echo "Error: Failed to register StarryNight theme with Spicetify"
exit 1
fi
🤖 Prompt for AI Agents
In Edited StarryNight around line 21, the spicetify config command is run
without checking its result; update the script to run the command and
immediately verify its exit status (e.g., using if ! spicetify config
current_theme StarryNight; then echo an error to stderr including the command
and exit with non‑zero status) so failures are reported and the script stops on
error.

@N1CK1111

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants