Giter VIP home page Giter VIP logo

mcthomas / apple-music-cli-player Goto Github PK

View Code? Open in Web Editor NEW
83.0 6.0 8.0 2.74 MB

A simple command-line Apple Music controller script which includes a "Now Playing" widget function, a playback function, and a list-out function for your Mac's Music.app library, written in sh.

License: MIT License

Shell 93.39% AppleScript 6.61%
apple applescript automation cli macos music osascript terminal tui widget

apple-music-cli-player's Issues

Option to disable album art?

First off, thank you for this! Nice to be able to have a CLI interface without the Music app in your face.

Is there a way to completely disable album art display? I would like to have the np output by itself and not have a big black square on the left side of the output.

am np results in timeout error

When I start am np I get the following error:
bash: line 0: read: .5: invalid timeout specification

It appears zsh (at least the version i'm running can't handle decimal numbers. If I change the following line
input=$(bash -c "read -n 1 -t .5 input; echo \$input | xargs")
to
input=$(bash -c "read -n 1 -t 1 input; echo \$input | xargs")
the error disappears.

macOS 12.6.1 and zsh 5.8.1 (x86_64-apple-darwin21.0)

Search for artist, album, song, playlist by pattern?

Would you consider adding the ability to search for content by pattern? This would just require adding a command-line option that would accept a pattern and then grepping that pattern from the osascript output.

For example,

am list -a -r '.*Monk.*'

would search for every artist with the string "Monk" in it, which would capture "Thelonious Monk," as well as "The Thelonious Monk Quartet," etc.

Maybe easier to just have it be a substring rather than regexp match so -r 'monk' would return everything that has "monk" anywhere in it.

pr -T 'illegal option'

Hi, thanks for this seemingly cool script, but my first test resulted in an error:

โžœ ~ am list -p pr: illegal option -- T usage: pr [+page] [-col] [-adFfmprt] [-e[ch][gap]] [-h header] [-i[ch][gap]] [-l line] [-n[ch][width]] [-o offset] [-L locale] [-s[ch]] [-w width] [-] [file ...]

Tested on macOS 12.6.1, and it appears pr -T is no longer a valid option.

Add albums to library from command-line?

This script works well for music already in the user's library. Might you consider expanding it to play content that isn't yet in the library? I think this should be possible with AppleScript. At a minimum, you can open a itms:// item from the shell which will cause that URL to start playing in Music.app, even if it's not currently in the library. These links can be found by web-searching for the album/artist/track name + music.apple.com, and then replacing https:// with itms://

content inset from left edge of terminal

Describe the bug
each line of the player begins at between 27 and 32 spaces from the left edge of the terminal

To Reproduce
running zsh am.sh np (default usage)

Expected behavior
text should be left justified

Desktop (please complete the following information):

  • OS: iOS Monterey

I cannot determine from the code what's causing the indenting. This behavior is probably by design, not a bug, but either way I would appreciate knowing how to adjust the appearance of the player, particularly, the indentation. Thanks very much. Really love this player.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.