Skip to content

Mac player #343

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Mac player #343

wants to merge 11 commits into from

Conversation

iberniex
Copy link

@iberniex iberniex commented May 29, 2025

Sorry for the delay, this is based on the enhancment pull request #336

The following things were done based on the tasks assigned to myself:

  • nativePlayer search
    • Spotify
    • Apple Music - Music
    • Tidal - not natively supported for applescript
  • browserPlayer (The active tab has to be youtube or spotify)
    • Google Chrome
    • Safari
    • Firefox ( not applescript supported )
    • Chromium and Firefox variants (arc, zed) - (not applescript supported)

Contains a remote feature but the apps only supported are:

  • spotify
  • music (apple music)

@Theoreticallyhugo
Copy link
Collaborator

hi,
thank you very much for your contribution! I didn't know that all of this was possible.
is this pr ready to be merged or a draft, considering that you haven't finished all the tasks?
since i had some issues getting your widget to work at first, i'd like to request @ethancedwards8 to review this too.
here's some feedback i gathered:

  • the @dracula-mac-player-length option is undocumented
  • you are mixing tab and spaces based indentation. that's no big issue though and i can fix that later.
  • i've had some issues with spotify not closing since using the script, though that may be an issue on my end...
  • i've tested native spotify and apple music as well as spotify via safari and can confirm that they're working ... after some fiddling. i really don't know what made it work in the end.
  • in line 31 you got an else that is immediately followed by and end if. i guess that won't hurt, but i wanted to point it out in case it's not intentional or could hurt. after all i've never used appleScript.

so far i have not tested:

  • chrome support
  • any other website than spotify in safari
  • playback control

Copy link

coderabbitai bot commented Jun 21, 2025

📝 Walkthrough

Walkthrough

A new "mac-player" plugin feature for tmux was introduced, including comprehensive documentation, a Bash script for macOS media control and display, and integration into the Dracula theme script. The documentation and scripts detail configuration, player detection, remote control keybindings, and visual customization for both native and browser-based music players.

Changes

File(s) Change Summary
docs/CONFIG.md Added detailed "mac-player" plugin documentation covering supported apps, remote control features, configuration options, TOC update, and formatting improvements.
scripts/dracula.sh Added "mac-player" plugin support: new purple color variable, plugin case reading tmux colors, and execution of mac-player.sh.
scripts/mac-player.sh New Bash script implementing macOS media player detection, track info retrieval, caching, remote control keybindings, and configuration handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant tmux
    participant dracula.sh
    participant mac-player.sh
    participant AppleScript
    participant MediaApp

    User->>tmux: Uses tmux with Dracula theme
    tmux->>dracula.sh: Requests plugin status
    dracula.sh->>mac-player.sh: Executes for "mac-player"
    mac-player.sh->>AppleScript: Queries active media player
    AppleScript->>MediaApp: Retrieves playback info
    MediaApp-->>AppleScript: Returns track/status
    AppleScript-->>mac-player.sh: Returns info
    mac-player.sh->>dracula.sh: Provides formatted track/status
    dracula.sh->>tmux: Displays music info in status bar
    User->>tmux: (Optional) Uses keybinding for media control
    tmux->>mac-player.sh: Triggers remote control command
    mac-player.sh->>AppleScript: Sends play/pause/next/back
    AppleScript->>MediaApp: Executes control command
Loading
✨ Finishing Touches
  • 📝 Docstrings were successfully generated. (🔄 Check again to generate docstrings again)- [ ] Create PR with Unit Tests
  • Post Copyable Unit Tests in 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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: 4

🧹 Nitpick comments (5)
scripts/dracula.sh (2)

59-59: Suppress ShellCheck warning for unused purple variable

The purple color variable is used indirectly via indirection (${!colors[0]}), so add a ShellCheck directive to silence SC2034.

-  purple="#b166cc"
+# shellcheck disable=SC2034
+  purple="#b166cc"

273-275: Align and harden the mac-player plugin block

Ensure consistent indentation, quote variables in tests, and prevent word splitting in the command substitution.

-    elif [ $plugin = "mac-player" ]; then
-      IFS=' ' read -r -a colors  <<< $(get_tmux_option "@dracula-mac-player-colors" "purple dark_gray")
-      script="#($current_dir/mac-player.sh)"
+    elif [ "$plugin" = "mac-player" ]; then
+      IFS=' ' read -r -a colors <<< "$(get_tmux_option "@dracula-mac-player-colors" "purple dark_gray")"
+      script="#(${current_dir}/mac-player.sh)"
scripts/mac-player.sh (3)

96-96: Use standard AppleScript comparison operator

AppleScript may not recognize the Unicode '≥'. Replace it with the ASCII operator >= for compatibility.

-      if (count of titleParts) ≥ 2 then
+      if (count of titleParts) >= 2 then

192-193: Improve cache file path scoping

Using a fixed /tmp/tmux_mac_player_cache can lead to conflicts between sessions and users. Generate a unique cache file per session or user.

-local cache_file="/tmp/tmux_mac_player_cache"
+cache_file="${TMPDIR:-/tmp}/tmux_mac_player_${TMUX_PANE:-$$}"

224-227: Use file modification time for cache staleness

stat -f %c returns inode change time. Use %m for modification time to reliably detect staleness.

-  if [ ! -f "$cache_file" ] || [ $(($(date +%s) - $(stat -f%c "$cache_file"))) -ge "$RATE" ]; then
+  if [ ! -f "$cache_file" ] || [ $(( $(date +%s) - $(stat -f%m "$cache_file") )) -ge "$RATE" ]; then
📜 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 405a4d0.

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

[warning] 59-59: purple appears unused. Verify use (or export if used externally).

(SC2034)


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

(SC2046)

🪛 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)


[grammar] ~514-~514: The modal verb ‘should’ requires the verb’s base form.
Context: ...c - Browser Players ( Active Tab should consists of this players ): - youtube.com/watc...

(MD_BASEFORM)


[grammar] ~514-~514: The singular determiner ‘this’ may not agree with the plural noun ‘players’. Did you mean “these”?
Context: ...Players ( Active Tab should consists of this players ): - youtube.com/watch - op...

(THIS_NNS)


[typographical] ~575-~575: 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] ~577-~577: 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] ~608-~608: 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] ~695-~695: 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)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


733-733: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)

Comment on lines 152 to 157
if [[ $len > $std ]]; then
result="${str:0:std}"
result+="..."
else
result=$str
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

Fix numeric comparison and substring expansion in sliceTrack

Use a numeric comparison (-gt or arithmetic context) and proper variable expansion for the substring length.

 function sliceTrack() {
   local str="$1"
   local std="$2"
-  local len=${#str}

-  if [[ $len > $std ]]; then
-    result="${str:0:std}"
+  local len=${#str}

+  if (( len > std )); then
+    result="${str:0:$std}"
     result+="..."
   else
     result=$str
📝 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 [[ $len > $std ]]; then
result="${str:0:std}"
result+="..."
else
result=$str
fi
if (( len > std )); then
result="${str:0:$std}"
result+="..."
else
result=$str
fi
🤖 Prompt for AI Agents
In scripts/mac-player.sh around lines 152 to 157, the comparison between $len
and $std uses a string comparison operator (>) instead of a numeric comparison,
and the substring expansion uses an unquoted variable which can cause issues.
Replace the string comparison with a numeric comparison using -gt or arithmetic
context, and ensure the substring length variable is properly expanded with
braces and no quotes to correctly slice the string.

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 (2)
docs/CONFIG.md (2)

25-25: Duplicate: TOC anchor fix applied
The [mac-player](#mac-player---up) link now matches the heading anchor. No further changes needed.


548-551: Fix typo in tmux option name
The option is declared as @dracule-mac-player-app but should use the dracula prefix.

- set -g @dracule-mac-player-app "Music"
+ set -g @dracula-mac-player-app "Music"
🧹 Nitpick comments (2)
docs/CONFIG.md (2)

511-517: Clarify browser support and correct grammar
The phrase “Active Tab should consists of this players” is ungrammatical and doesn’t call out browser requirements.

Proposed diff:

 ### mac-player - [up](#table-of-contents)
 This widget and script displays music information provided by the native macOS players.

 The current supported apps are:

 - Native Players:
   - Spotify
   - Music - Apple Music
 - Browser Players ( Active Tab should consists of this players ):
-  - youtube.com/watch
-  - open.spotify.com
+  - Browser Players (active tab must match one of these URLs and requires Google Chrome or Safari):
+    - youtube.com/watch
+    - open.spotify.com

540-543: Specify code block language
The remote‐activation block lacks a language hint. For consistency, change the opening fence to ​```bash.

- ```
+ ```bash
 set -g @dracula-mac-player-remote true

</blockquote></details>

</blockquote></details>

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

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


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

Reviewing files that changed from the base of the PR and between 405a4d08edb00bd247926c00c0a7e8b75a0181c8 and 3e86f3a5faa42a240673c2ad6429ef4f425706a6.

</details>

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

* `docs/CONFIG.md` (15 hunks)
* `scripts/mac-player.sh` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* scripts/mac-player.sh

</details>

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

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

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

[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)

---

[grammar] ~514-~514: The modal verb ‘should’ requires the verb’s base form.
Context: ...c - Browser Players ( Active Tab should consists of this players ):   - youtube.com/watc...

(MD_BASEFORM)

---

[grammar] ~514-~514: The singular determiner ‘this’ may not agree with the plural noun ‘players’. Did you mean “these”?
Context: ...Players ( Active Tab should consists of this players ):   - youtube.com/watch   - op...

(THIS_NNS)

---

[typographical] ~581-~581: 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] ~583-~583: 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] ~614-~614: 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] ~701-~701: 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)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

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

327-327: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

---

739-739: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

---

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

(MD040, fenced-code-language)

</details>

</details>

</details>

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

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

`4-4`: **Skip trivial formatting change**  
The inserted blank line after the “## Table of Contents” heading is a minor style tweak.

---

`505-523`: **Approve mac-player section introduction**  
The new plugin overview is clear, follows the existing style, and correctly lists supported native and browser players along with a note on refresh rate.

---

`528-532`: **Approve icon customization example**  
The play/pause icon variables are documented correctly and follow the same pattern as other plugins.

---

`536-539`: **Approve length customization example**  
The `@dracula-mac-player-length` option is properly documented with a default value.

</details>

</blockquote></details>

</details>

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

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

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

505-565: Review mac-player plugin documentation

  • Verify that each @dracula-mac-player-* option name and its default value in this section aligns exactly with the defaults and flags implemented in scripts/mac-player.sh.
  • Grammar nit: “This widget and script displays music information…” → “This widget and script display music information…”
  • UX suggestion: consider renaming @dracula-mac-player-remote-pp to something more descriptive (e.g., @dracula-mac-player-play-pause) to match the style of other keybinding options.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3e86f3a and 829c676.

📒 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] ~581-~581: 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] ~583-~583: 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] ~614-~614: 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] ~701-~701: 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)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


739-739: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)

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

4-4: Minor whitespace adjustment for formatting; no action required.


25-25: TOC entry for new plugin
The mac-player entry correctly follows the existing TOC pattern and matches its section anchor (#mac-player---up).

@iberniex
Copy link
Author

Hey @Theoreticallyhugo,

Sorry for the miscommunication on the tasks, I did some digging and found out that firefox is also not supported by applescript so I placed the empty tasks for anyone who has something to add on that. So to conclude on the first point, yes it can be merged.

the @dracula-mac-player-length option is undocumented

I've documented the variable I forgot about it.

you are mixing tab and spaces based indentation. that's no big issue though and i can fix that later.

This is may be due to my formatting but I've fixed where necessary.

i've had some issues with spotify not closing since using the script, though that may be an issue on my end...

This is caused by activating the remote flag due to the default option being spotify. I got this a lot when I turned it into Music as my app but after sometime it stopped. Maybe if a lot people can test it and then we can find more issues that arise.

in line 31 you got an else that is immediately followed by and end if. i guess that won't hurt, but i wanted to point it out in case it's not intentional or could hurt. after all i've never used appleScript.

Oh yeah. I was so into the working part and forgot to proof read but I've removed the else.

For the other browsers, they don't have applescript support and the only option is javascript injections and some weird hacky UI scripting which is bad. Tidal are not focused on applescript support so we can disregard those options at this point.

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

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

526-538: Document customization options concisely
Icon (@dracula-mac-player-play-icon, @dracula-mac-player-pause-icon) and length (@dracula-mac-player-length) options are clear. You may want to note default values inline (e.g., for play, ❚❚ for pause, length 25) for quick reference.


540-550: Clarify activation and app selection
@dracula-mac-player-remote and @dracula-mac-player-app are well-documented. Consider validating that the app value is one of "Music" or "Spotify" in the script and mention fallback behavior in the docs.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 829c676 and 0c61664.

📒 Files selected for processing (2)
  • docs/CONFIG.md (15 hunks)
  • scripts/mac-player.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/mac-player.sh
🧰 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] ~581-~581: 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] ~583-~583: 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] ~614-~614: 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] ~701-~701: 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)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


739-739: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)

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

4-4: skip formatting-only change
Blank line insertion for spacing.


25-25: Confirm correct TOC anchor for mac-player
The entry now links to #mac-player---up, matching the section heading's anchor.


92-92: skip formatting-only change
Blank line insertion after Powerline heading.


100-100: skip formatting-only change
Blank line insertion before Enable edge icons code block.


151-151: skip formatting-only change
Blank line insertion before left-icon padding example.


219-219: skip formatting-only change
Formatting adjustment before compact-alt instructions.


505-514: Add mac-player plugin section header
The new section clearly introduces the macOS music player widget. Consider specifying any prerequisites (e.g., tmux version or AppleScript permission).


511-517: List supported native and browser players accurately
Good clarity on native (Spotify, Music) and browser (YouTube, Spotify web) apps. If future support is planned for additional URLs or browsers, note it here.


518-523: Detail the remote-player feature scope
The supported remote players mirror the display section—Spotify and Apple Music. Consider specifying that the remote control also uses AppleScript and may require enabling “Accessibility” for terminal apps.


552-564: Include default and custom keybinding guidance
Default (P, R, N) and customizable remote keybindings are described. For completeness, you could mention how to unbind or reassign if conflicts occur.

coderabbitai bot added a commit that referenced this pull request Jun 25, 2025
Docstrings generation was requested by @ethancedwards8.

* #343 (comment)

The following files were modified:

* `scripts/dracula.sh`
* `scripts/mac-player.sh`
@dracula dracula deleted a comment from coderabbitai bot Jun 25, 2025
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