-
Notifications
You must be signed in to change notification settings - Fork 338
feat:spr plugin #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:spr plugin #344
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change intentional?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
📝 WalkthroughWalkthroughAdds a new "spr" Spotify plugin: docs TOC and section in Changes
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
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 detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these settings in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 ]; thendocs/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" -``` +```bashAlso applies to: 658-660, 670-673
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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 newspr
plugin entry in the Table of Contents matches the section heading and fragment.
There was a problem hiding this 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
📒 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)
There was a problem hiding this 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 usesset remote-g @dracula-refresh-rate 5
, which should beset -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
📒 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 forspr
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 forspr
Plugin
The heading### spr - [up](#table-of-contents)
is consistent with other plugin sections.
642-642
: Refresh Rate Note
The noteNOTE: \
set -g @dracula-refresh-rate 5` affects this widget` follows the established pattern.
644-644
: Player Icon Configuration
The instructionTo 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 snippetset -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.
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 |
The spotify_player tui supports various linux distributions is not only for macos. If you have cargo installed you can install it seemlessly. |
There was a problem hiding this 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 flagremote-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 intentionallyShellcheck flags the unquoted command substitution.
If you do want the value to be fed toread
as a single string (split afterwards byIFS
), 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 oneThe 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
📒 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)
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? besides it's displaying well! formatting options like there used to be with spotify-tui would be cool, but not a must ( |
I just noticed that and will try to solve this issue. is it when you do the 'R' remote command? # 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
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. |
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 and also polished up the remote control issues and still working on the formatting options. |
There was a problem hiding this 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
istrue
and are removed when it is set tofalse
.</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
### 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 "❚❚ " | ||
|
||
``` |
There was a problem hiding this comment.
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.
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! |
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 :) |
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.