Skip to content

Conversation

iberniex
Copy link
Contributor

@iberniex iberniex commented May 29, 2025

This is based on the creation of spotify-player widget for the spotify-player app based on #336

There is also a remote option but it has some issues with latency and needs the daemon to be installed but limits the refresh rate on the display widget.

docs/CONFIG.md Outdated
```bash
set -g @dracula-spotify-tui-max-len 30
```

`set -g @dracula-refresh-rate 5` affects this widget
`set remote-g @dracula-refresh-rate 5` affects this widget
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this change intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I noticed that the when I place like a refresh rate lke 2, the presentation was faster. Maybe it's an issue with my current installation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

since the refresh rate option is essentially a sleep statement, lower numbers should yield less delay between the refreshes, so what you say makes sense. however, im am a little confused as to why you changed the flag from -g to remote-g which i think would be considered illegal syntax. hence the question of whether this is intentional. sorry for having been so unclear

Copy link

coderabbitai bot commented Jun 21, 2025

📝 Walkthrough

Walkthrough

Adds a new "spr" Spotify plugin: docs TOC and section in docs/CONFIG.md, a plugin case in scripts/dracula.sh, and a new scripts/spr.sh that queries spotify_player for playback, formats/truncates and caches output, and optionally binds tmux keys for remote control.

Changes

Cohort / File(s) Change Summary
Docs: plugin entry
docs/CONFIG.md
Inserted spr into Plugins TOC and added a new spr documentation section (usage, dependency spotify-player, refresh-rate note removed from mac-player), and declared public config options: @dracula-spr-play-icon, @dracula-spr-pause-icon, @dracula-spr-remote, @dracula-spr-remote-play-pause, @dracula-spr-remote-back, @dracula-spr-remote-next.
Main plugin loader
scripts/dracula.sh
Added "spr" case to plugin selection; reads @dracula-spr-colors (default "green dark_gray") and sets execution to ./scripts/spr.sh.
New plugin implementation
scripts/spr.sh
Added new Bash script that queries spotify_player for playback JSON, parses play/pause and track info, truncates long strings, caches output per refresh rate to reduce lag, verifies spotify_player presence, and binds/unbinds tmux keys for play/pause/prev/next remote control.

Sequence Diagram(s)

sequenceDiagram
    participant Tmux
    participant dracula.sh
    participant spr.sh
    participant spotify_player

    Tmux->>dracula.sh: request status (plugin="spr")
    dracula.sh->>spr.sh: execute
    spr.sh->>spotify_player: get key playback
    spotify_player-->>spr.sh: JSON playback info
    spr.sh->>spr.sh: parse, format, truncate, cache
    spr.sh-->>Tmux: formatted track line

    alt remote control enabled
        Tmux->>spr.sh: keypress (play/pause/next/back)
        spr.sh->>spotify_player: send control command
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Mac player #343 — Adds a media-player plugin with similar functions (trackStatus, sliceTrack) and remote-control keybinding logic; likely closely related.

Suggested reviewers

  • ethancedwards8

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0aa155d and 7cf2f55.

📒 Files selected for processing (1)
  • scripts/spr.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/spr.sh
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 2

🧹 Nitpick comments (4)
scripts/dracula.sh (1)

275-278: Quote substitutions in color option parsing
The here-string expansion should be quoted to prevent unintended word splitting when colors include spaces.
Apply this diff:

-    IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spr-colors" "green dark_gray")
+    IFS=' ' read -r -a colors <<< "$(get_tmux_option "@dracula-spr-colors" "green dark_gray")"
scripts/spr.sh (1)

108-111: Improve cache timestamp portability
stat -f%c is BSD-specific and will fail on Linux. Use a portable method to retrieve file modification time:

-  if [ ! -f "$cache_file" ] || [ $(($(date +%s) - $(stat -f%c "$cache_file"))) -ge "$RATE" ]; then
+  if [ ! -f "$cache_file" ] || [ $(( $(date +%s) - $(date +%s -r "$cache_file") )) -ge $RATE ]; then
docs/CONFIG.md (2)

639-642: Clarify remote feature description and correct casing
Rewrite for clarity and consistency with macOS styling:

-This contains a remote (experimental) but limits the use of the display widget in MacOS.
+This section includes an experimental remote control feature, but it may limit the widget’s display on macOS.

646-649: Specify code block languages for syntax highlighting
Add the language identifier to all fenced blocks to improve readability and consistency:

-``` 
+```bash
 set -g @dracula-spr-play-icon "♪ "
 set -g @dracula-spr-pause-icon "❚❚ "
-``` 
+```bash
 set -g @dracula-spr-remote true
-``` 
+```bash
 set -g @dracula-spr-remote-pp "P"
 set -g @dracula-spr-remote-back "R"
 set -g @dracula-spr-remote-next "N"
-``` 
+```bash

Also applies to: 658-660, 670-673

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3323120 and 38f3121.

📒 Files selected for processing (3)
  • docs/CONFIG.md (15 hunks)
  • scripts/dracula.sh (1 hunks)
  • scripts/spr.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
scripts/dracula.sh

[warning] 276-276: Quote this to prevent word splitting.

(SC2046)

🪛 markdownlint-cli2 (0.17.2)
docs/CONFIG.md

33-33: Link fragments should be valid
null

(MD051, link-fragments)


327-327: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


539-539: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


616-616: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


693-693: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


715-715: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


717-717: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


759-759: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


765-765: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


775-775: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🪛 LanguageTool
docs/CONFIG.md

[uncategorized] ~219-~219: Possible missing comma found.
Context: .... _make sure to include the compact-alt widget as you won't be able to switch out of n...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~316-~316: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ...orking directory, where the path of the users home directory will be shortened to ~...

(AI_HYDRA_LEO_APOSTROPHE_S_XS)


[uncategorized] ~339-~339: It appears that hyphens are missing in the adjective “up-to-date”.
Context: ...` Set symbol to use for when branch is up to date with HEAD ```bash # default is ✓. Avoi...

(UP_TO_DATE_HYPHEN)


[grammar] ~382-~382: The operating system from Apple is written “macOS”.
Context: ... - partial support for apple m-chips on MacOS. - partial support for amd and intel on...

(MAC_OS)


[uncategorized] ~436-~436: It appears that hyphens are missing in the adjective “up-to-date”.
Context: ...` Set symbol to use for when branch is up to date with HEAD ```bash #default is ✓.Avoid ...

(UP_TO_DATE_HYPHEN)


[typographical] ~520-~520: Usually, there’s no comma before “if”.
Context: ...nly display the wifi you're connected to, if it provides internet access!** You can...

(IF_NO_COMMA)


[style] ~522-~522: Consider a more concise word here.
Context: ...** You can use different hosts to ping in order to check for a wifi or wired connection. I...

(IN_ORDER_TO_PREMIUM)


[grammar] ~553-~553: The verb form ‘are’ does not seem to match the subject ‘name’.
Context: ...rface. The most common interfaces name are eth0 for a wired connection and `wlan...

(SUBJECT_VERB_AGREEMENT)


[grammar] ~652-~652: The operating system from Apple is written “macOS”.
Context: ...limits the use of the display widget in MacOS. In order to utilize the remote featur...

(MAC_OS)


[style] ~653-~653: Consider a more concise word here.
Context: ...he use of the display widget in MacOS. In order to utilize the remote feature you need to ...

(IN_ORDER_TO_PREMIUM)


[typographical] ~654-~654: It seems that a comma is missing.
Context: ... MacOS. In order to utilize the remote feature you need to install the [spotify-player...

(IN_ORDER_TO_VB_COMMA)


[grammar] ~677-~677: Probable usage error. Use “and” after ‘both’.
Context: ... combination, both of the local machine as well as when connected via ssh. To output noth...

(BOTH_AS_WELL_AS)

🔇 Additional comments (1)
docs/CONFIG.md (1)

33-33: TOC entry added correctly
The new spr plugin entry in the Table of Contents matches the section heading and fragment.

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 38f3121 and c77118b.

📒 Files selected for processing (2)
  • docs/CONFIG.md (15 hunks)
  • scripts/spr.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/spr.sh
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/CONFIG.md

33-33: Link fragments should be valid
null

(MD051, link-fragments)


327-327: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


539-539: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


616-616: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


693-693: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


715-715: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


717-717: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


759-759: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


765-765: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


775-775: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🪛 LanguageTool
docs/CONFIG.md

[uncategorized] ~219-~219: Possible missing comma found.
Context: .... _make sure to include the compact-alt widget as you won't be able to switch out of n...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~316-~316: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ...orking directory, where the path of the users home directory will be shortened to ~...

(AI_HYDRA_LEO_APOSTROPHE_S_XS)


[uncategorized] ~339-~339: It appears that hyphens are missing in the adjective “up-to-date”.
Context: ...` Set symbol to use for when branch is up to date with HEAD ```bash # default is ✓. Avoi...

(UP_TO_DATE_HYPHEN)


[grammar] ~382-~382: The operating system from Apple is written “macOS”.
Context: ... - partial support for apple m-chips on MacOS. - partial support for amd and intel on...

(MAC_OS)


[uncategorized] ~436-~436: It appears that hyphens are missing in the adjective “up-to-date”.
Context: ...` Set symbol to use for when branch is up to date with HEAD ```bash #default is ✓.Avoid ...

(UP_TO_DATE_HYPHEN)


[typographical] ~520-~520: Usually, there’s no comma before “if”.
Context: ...nly display the wifi you're connected to, if it provides internet access!** You can...

(IF_NO_COMMA)


[style] ~522-~522: Consider a more concise word here.
Context: ...** You can use different hosts to ping in order to check for a wifi or wired connection. I...

(IN_ORDER_TO_PREMIUM)


[grammar] ~553-~553: The verb form ‘are’ does not seem to match the subject ‘name’.
Context: ...rface. The most common interfaces name are eth0 for a wired connection and `wlan...

(SUBJECT_VERB_AGREEMENT)


[style] ~653-~653: Consider a more concise word here.
Context: ...y limit the widget’s display on macOS. In order to utilize the remote feature you need to ...

(IN_ORDER_TO_PREMIUM)


[typographical] ~654-~654: It seems that a comma is missing.
Context: ... macOS. In order to utilize the remote feature you need to install the [spotify-player...

(IN_ORDER_TO_VB_COMMA)


[grammar] ~677-~677: Probable usage error. Use “and” after ‘both’.
Context: ... combination, both of the local machine as well as when connected via ssh. To output noth...

(BOTH_AS_WELL_AS)

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: 0

♻️ Duplicate comments (1)
docs/CONFIG.md (1)

636-636: Correct tmux Option Syntax for Refresh Rate
This line still uses set remote-g @dracula-refresh-rate 5, which should be set -g @dracula-refresh-rate 5.

🧹 Nitpick comments (2)
docs/CONFIG.md (2)

219-219: Sentence Capitalization
The line starts with a lowercase “to”. Consider capitalizing it:

- to set what widgets should be shown in narrow mode, set the following variable...
+ To set what widgets should be shown in narrow mode, set the following variable...

654-655: Grammar & Conciseness
Consider simplifying and adding a comma for clarity:

- In order to utilize the remote feature you need to install the spotify-player-daemon
+ To utilize the remote feature, install the spotify-player-daemon
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c77118b and c155992.

📒 Files selected for processing (1)
  • docs/CONFIG.md (15 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/CONFIG.md

[uncategorized] ~219-~219: Possible missing comma found.
Context: .... _make sure to include the compact-alt widget as you won't be able to switch out of n...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~316-~316: It seems likely that a singular genitive (’s) apostrophe is missing.
Context: ...orking directory, where the path of the users home directory will be shortened to ~...

(AI_HYDRA_LEO_APOSTROPHE_S_XS)


[uncategorized] ~339-~339: It appears that hyphens are missing in the adjective “up-to-date”.
Context: ...` Set symbol to use for when branch is up to date with HEAD ```bash # default is ✓. Avoi...

(UP_TO_DATE_HYPHEN)


[grammar] ~382-~382: The operating system from Apple is written “macOS”.
Context: ... - partial support for apple m-chips on MacOS. - partial support for amd and intel on...

(MAC_OS)


[uncategorized] ~436-~436: It appears that hyphens are missing in the adjective “up-to-date”.
Context: ...` Set symbol to use for when branch is up to date with HEAD ```bash #default is ✓.Avoid ...

(UP_TO_DATE_HYPHEN)


[typographical] ~520-~520: Usually, there’s no comma before “if”.
Context: ...nly display the wifi you're connected to, if it provides internet access!** You can...

(IF_NO_COMMA)


[style] ~522-~522: Consider a more concise word here.
Context: ...** You can use different hosts to ping in order to check for a wifi or wired connection. I...

(IN_ORDER_TO_PREMIUM)


[grammar] ~553-~553: The verb form ‘are’ does not seem to match the subject ‘name’.
Context: ...rface. The most common interfaces name are eth0 for a wired connection and `wlan...

(SUBJECT_VERB_AGREEMENT)


[style] ~653-~653: Consider a more concise word here.
Context: ...y limit the widget’s display on macOS. In order to utilize the remote feature you need to ...

(IN_ORDER_TO_PREMIUM)


[typographical] ~654-~654: It seems that a comma is missing.
Context: ... macOS. In order to utilize the remote feature you need to install the [spotify-player...

(IN_ORDER_TO_VB_COMMA)


[grammar] ~677-~677: Probable usage error. Use “and” after ‘both’.
Context: ... combination, both of the local machine as well as when connected via ssh. To output noth...

(BOTH_AS_WELL_AS)

🪛 markdownlint-cli2 (0.17.2)
docs/CONFIG.md

327-327: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


539-539: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


616-616: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


693-693: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


715-715: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


717-717: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


759-759: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


765-765: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


775-775: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🔇 Additional comments (9)
docs/CONFIG.md (9)

4-4: Trivial blank line insertions for improved readability.

Also applies to: 92-92, 100-100, 126-126, 151-151, 637-637


33-33: TOC Entry for spr Plugin Added
The new Table of Contents entry - [spr](#spr---up) matches the heading’s anchor pattern and is consistent with other plugins.


638-638: Header for spr Plugin
The heading ### spr - [up](#table-of-contents) is consistent with other plugin sections.


642-642: Refresh Rate Note
The note NOTE: \set -g @dracula-refresh-rate 5` affects this widget` follows the established pattern.


644-644: Player Icon Configuration
The instruction To change player icons: aligns with other “To change” sections.


646-649: Play/Pause Icon Snippet
The provided code block correctly shows how to set the play and pause icons.


652-652: Experimental Remote Feature Note
The notice about the experimental remote control feature is clear and properly formatted.


658-659: Enable Remote Snippet
The snippet set -g @dracula-spr-remote true correctly shows how to activate remote control.


669-673: Remote Keybindings Snippet
The code block for customizing <prefix> + P/R/N is consistent and clear.

@Theoreticallyhugo
Copy link
Collaborator

hi, im sorry for the long wait. currently im rarely using macos, so i dont really get to install and test fancy things on it. ill try not to keep you waiting for too long anymore

@iberniex
Copy link
Contributor Author

The spotify_player tui supports various linux distributions is not only for macos. If you have cargo installed you can install it seemlessly.

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: 0

♻️ Duplicate comments (1)
docs/CONFIG.md (1)

718-720: Invalid tmux flag remote-g; should be -g

remote-g is not recognised by tmux. Fix the example:

-`set remote-g @dracula-refresh-rate 5` affects this widget
+`set -g @dracula-refresh-rate 5` affects this widget
🧹 Nitpick comments (2)
scripts/dracula.sh (1)

281-283: Shellcheck SC2046 – quote the command-substitution or silence intentionally

Shellcheck flags the unquoted command substitution.
If you do want the value to be fed to read as a single string (split afterwards by IFS), quoting is safe and silences the warning:

-      IFS=' ' read -r -a colors <<<$(get_tmux_option "@dracula-spr-colors" "green dark_gray")
+      IFS=' ' read -r -a colors <<<"$(get_tmux_option "@dracula-spr-colors" "green dark_gray")"

Alternatively add # shellcheck disable=SC2046 for consistency with the rest of the file.

docs/CONFIG.md (1)

725-758: Duplicate refresh-rate note – keep only one

The sentence noting that @dracula-refresh-rate affects the widget appears twice (lines 725 and 758). Removing the second keeps the section concise.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f65a4e1 and 170a73c.

📒 Files selected for processing (2)
  • docs/CONFIG.md (3 hunks)
  • scripts/dracula.sh (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
scripts/dracula.sh (1)
scripts/utils.sh (1)
  • get_tmux_option (3-12)
🪛 LanguageTool
docs/CONFIG.md

[style] ~736-~736: Consider a more concise word here.
Context: ...y limit the widget’s display on macOS. In order to utilize the remote feature you need to ...

(IN_ORDER_TO_PREMIUM)

🪛 Shellcheck (0.10.0)
scripts/dracula.sh

[warning] 282-282: Quote this to prevent word splitting.

(SC2046)

@Theoreticallyhugo
Copy link
Collaborator

Theoreticallyhugo commented Jul 19, 2025

is it normal for the tmux session to switch to a blank screen till you press enter when trying to use the remote control feature?
i guess that would be OK for an experimental feature, but maybe it's also just a mistake on my end?

besides it's displaying well! formatting options like there used to be with spotify-tui would be cool, but not a must (set -g @dracula-spotify-tui-format "%f %s %t - %a")

@iberniex
Copy link
Contributor Author

iberniex commented Jul 19, 2025

is it normal for the tmux session to switch to a blank screen till you press enter when trying to use the remote control feature?

I just noticed that and will try to solve this issue.

is it when you do the 'R' remote command?
Oh cause I just noticed that when you use the 'R' keybind, it displays the osascript mac player command so I'll do a slight patch on the mac-player plugin for the remote feature which was previously like this.

  # Remote Access
  if [[ "$REMOTE_ACCESS" == true ]]; then
    remoteControl "$PLAY_PAUSE_BUTTON" "$BACK_BUTTON" "$NEXT_BUTTON" "$REMOTE_APP"
  fi

then add a guard to prevent the commands from leaking to other commands in tmux. my bad :p .

  if [[ "$REMOTE_ACCESS" == "true" ]]; then

    # Remote Control Buttons Customizations
    PLAY_PAUSE_BUTTON=$(get_tmux_option "@dracula-mac-player-remote-play-pause" "P")
    BACK_BUTTON=$(get_tmux_option "@dracula-mac-player-remote-back" "R")
    NEXT_BUTTON=$(get_tmux_option "@dracula-mac-player-remote-next" "N")

    remoteControl "$PLAY_PAUSE_BUTTON" "$BACK_BUTTON" "$NEXT_BUTTON" "$REMOTE_APP"
  else
    tmux set -g @dracula-mac-player-remote-play-pause ""
    tmux set -g @dracula-mac-player-remote-back ""
    tmux set -g @dracula-mac-player-remote-next ""
  fi

besides it's displaying well! formatting options like there used to be with spotify-tui would be cool, but not a must (set -g >@dracula-spotify-tui-format "%f %s %t - %a")

for the formatting options, I was finding ways to store the fields separately to the formatting options like in spotify-tui cause spotify-player doesn't provide the formatting options. The data they expose is in json but I'll figure something out.

@iberniex
Copy link
Contributor Author

so I found out that I was solving another error based on the mac-player where spotify does not have a back track option in applescript.

For the terminal going blank issue, I researched and found out the tui commands creates an exit command that leads to tmux showing a blank page.

I've added this prefix > /dev/null 2>&1 so that it doesnt output anything but makes tmux freeze for a bit then it works on my end.
Feel free to test on it :)

and also polished up the remote control issues and still working on the formatting options.

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: 1

♻️ Duplicate comments (1)
docs/CONFIG.md (1)

34-34: TOC anchor for spr fixed correctly.

The link now targets #spr---up, matching the heading pattern used elsewhere. LGTM.

🧹 Nitpick comments (2)
docs/CONFIG.md (2)

735-738: Tighten wording; clarify daemon must be running.

Minor style nit and a small clarity boost that the daemon must be running, not just installed.

-This section includes an experimental remote control feature, but it may limit the widget’s display on macOS.
-
-In order to utilize the remote feature you need to install the [spotify-player-daemon](https://github.com/aome510/spotify-player#daemon)
+This section includes an experimental remote control feature, but it may limit the widget’s display on macOS.
+
+To use the remote feature, install and run the [spotify-player-daemon](https://github.com/aome510/spotify-player#daemon).

744-756: Mention keybind lifecycle when disabling remote.

Helpful to set expectations that keybinds are only active when remote is enabled and get cleaned up when disabled.

 The default keybinds are:

 - `<prefix> + P` - Play/Pause
 - `<prefix> + R` - Back to position 0/previous track
 - `<prefix> + N` - Next track

 To change the keybinds:
@@
 set -g @dracula-spr-remote-back "R"
 set -g @dracula-spr-remote-next "N"

+Note: Keybinds are applied only when @dracula-spr-remote is true and are removed when it is set to false.


</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

**💡 Knowledge Base configuration:**

- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 0dce28cb762aaf6ae05705ed77ba15ed9aa2b3de and 7625de4c2a5db5ceb45d11e99cb904f67897e1fe.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/CONFIG.md` (3 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>docs/CONFIG.md</summary>

[style] ~736-~736: Consider a more concise word here.
Context: ...y limit the widget’s display on macOS.  In order to utilize the remote feature you need to ...

(IN_ORDER_TO_PREMIUM)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>docs/CONFIG.md (1)</summary>

`718-720`: **Good: refresh-rate note retained for spotify-tui.**

Consistent with other widgets and helpful for users.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

docs/CONFIG.md Outdated
Comment on lines 721 to 733
### spr - [up](#table-of-contents)

This widget displays music information provided by [spotify-player](https://github.com/aome510/spotify-player). spotify-player must be installed to use this widget.

NOTE: `set -g @dracula-refresh-rate 5` affects this widget

To change player icons:

```bash
set -g @dracula-spr-play-icon "♪ "
set -g @dracula-spr-pause-icon "❚❚ "

```
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Document spr colors (and verify max-length option).

  • Consider adding the standard colors override example for spr to keep docs consistent with other plugins.
  • The implementation reportedly supports truncation/max length. If there is a tmux option for this (e.g., @dracula-spr-max-len), please document it here.

Proposed doc additions (colors are safe; max-len requires verifying the exact option name):

 ### spr - [up](#table-of-contents)

 This widget displays music information provided by [spotify-player](https://github.com/aome510/spotify-player). spotify-player must be installed to use this widget.

 NOTE: `set -g @dracula-refresh-rate 5` affects this widget

 To change player icons:
@@
 set -g @dracula-spr-pause-icon "❚❚ "

+# Optionally set background/foreground colors:
+# default available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
+# set -g @dracula-spr-colors "[background] [foreground]"
+set -g @dracula-spr-colors "green dark_gray"
+
+# To limit the maximum length (0 means unlimited length):
+# NOTE: verify the exact option name in scripts/spr.sh before documenting.
+# set -g @dracula-spr-max-len 30


To confirm the exact option name for max length, run:

---

🏁 Script executed:

```shell
#!/bin/bash
# Find all documented tmux options related to spr
rg -n '@dracula-spr' -A 2

# Also look for "max" or "len" around spr to spot the length option
rg -n '(max|len)' scripts/spr.sh -A 3 -B 3 || true

Length of output: 2337


Document spr colors and max-length option (verified)

Confirmed option names; please add docs for colors and max-length.

  • scripts/spr.sh — MAX_LENGTH="$(get_tmux_option "@dracula-spr-length" 25)" (line ~80) — default 25
  • scripts/dracula.sh — get_tmux_option "@dracula-spr-colors" "green dark_gray" (line ~282) — default "green dark_gray"
  • Edit docs/CONFIG.md around the spr widget (near lines 730–733) to include these options

Suggested doc diff to apply:

 ### spr - [up](#table-of-contents)

 This widget displays music information provided by [spotify-player](https://github.com/aome510/spotify-player). spotify-player must be installed to use this widget.

 NOTE: `set -g @dracula-refresh-rate 5` affects this widget

 To change player icons:
@@
 set -g @dracula-spr-pause-icon "❚❚ "

+# Optionally set background/foreground colors (default: "green dark_gray"):
+set -g @dracula-spr-colors "green dark_gray"
+
+# To limit the maximum text length shown (0 = unlimited). Default is 25:
+set -g @dracula-spr-length 30


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **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.

```suggestion
### spr - [up](#table-of-contents)

This widget displays music information provided by [spotify-player](https://github.com/aome510/spotify-player). spotify-player must be installed to use this widget.

NOTE: `set -g @dracula-refresh-rate 5` affects this widget

To change player icons:

🤖 Prompt for AI Agents
In docs/CONFIG.md around lines 721–733 (the spr widget section), add
documentation for the spr color and max-length options: document
@dracula-spr-colors with its default value "green dark_gray" and note it sets
background/foreground colors for the widget, and document @dracula-spr-length
with default 25 (explain 0 = unlimited) and that it limits the displayed text
length; include example set -g lines matching the repo naming
(@dracula-spr-colors and @dracula-spr-length) and a short note about the
defaults.

@Theoreticallyhugo
Copy link
Collaborator

i don't have spotify premium anymore, but this looks good to me, so i'll merge it. thank you for your efforts and patience!
feel free to send in patches if you feel like i merged to early and you want to add something

@Theoreticallyhugo Theoreticallyhugo merged commit 3987eec into dracula:master Aug 14, 2025
2 checks passed
@iberniex iberniex deleted the spr branch August 23, 2025 11:42
@iberniex
Copy link
Contributor Author

yeah for sure I'll patch for any issues relating to the plugin and also I've found a solution to the formatting feature and will present it soon :)

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

Successfully merging this pull request may close these issues.

2 participants