Giter VIP home page Giter VIP logo

Comments (9)

albert-ying avatar albert-ying commented on June 9, 2024 1

Thanks, now I can run np with zsh with no error! It still blinks, though, I guess that is not avoidable?

p.s. works great with cava ;)
image

from apple-music-cli-player.

albert-ying avatar albert-ying commented on June 9, 2024 1

Thanks! It stops blinking after I pull the latest commit

One question -- is it possible to play from the station using this tool?

from apple-music-cli-player.

mcthomas avatar mcthomas commented on June 9, 2024 1

I am glad, though I think blinking will persist for some of the heavier terminal emulators, unfortunately, and there isn't much I can do about it.

I don't believe you can use AppleScript to begin playback from a Radio Station, unfortunately, because Radio Stations are not defined in Music.sdef (from Script Editor.app's Dictionary). Furthermore, there's really no way to save those to your library.

from apple-music-cli-player.

mcthomas avatar mcthomas commented on June 9, 2024

Hi @albert-ying ,

Sorry about that! Seems to be zsh specific, I don't see this artifact when the script is run with bash. Read from stdin works differently in bash and zsh. I just added a call to bash for that line (bash isn't going anywhere anytime soon, even though zsh is default on macOS).

Please pull down and let me know if that resolved the issue.

from apple-music-cli-player.

albert-ying avatar albert-ying commented on June 9, 2024

Thanks for the quick reply!

Now it looks like this

bash: line 0: read: .5: invalid timeout specification
/usr/bin/read: line 4: read: -N: invalid option
read: usage: read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]

Also, if seems that I can't run it use bash

❯ bash am.sh np
am.sh: line 26: arr: bad array subscript
am.sh: line 43: arr: bad array subscript
am.sh: line 87: (curr * 100) / end / 10 : division by 0 (error token is "/ 10 ")

❯ bash am.sh list -a
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 ...]
``

from apple-music-cli-player.

mcthomas avatar mcthomas commented on June 9, 2024

As I have indicated in the readme, for np, you need to have a song playing or paused. That's usually the error you'll otherwise see because there is no song duration for it to parse and operate on. Sorry for that inconvenience.

For the other error, are you using Darwin's bash or a bash package from elsewhere? Check with bash --version. It could also be related to the fact that I have an sh shebang instead of a bash shebang on top of the script. I just updated this in case it is the culprit for your system. Let me know what happens after you pull down again.

from apple-music-cli-player.

albert-ying avatar albert-ying commented on June 9, 2024

Hi Thomas, I pull the lastest version.

See attached screen recording

https://share.cleanshot.com/jghCmg

My bash is the darwin

❯ bash --version
GNU bash, version 3.2.57(1)-release (arm64-apple-darwin22)
Copyright (C) 2007 Free Software Foundation, Inc.

from apple-music-cli-player.

mcthomas avatar mcthomas commented on June 9, 2024

I think we might've found the problem. My bash is

GNU bash, version 5.2.2(1)-release (x86_64-apple-darwin21.6.0)
Copyright (C) 2022 Free Software Foundation, Inc.

It is I who has a newer Darwin package. And the original package, the default that you have, must have issues with my expressions' syntax and with cut as they appear in np(), as well as with the pr option T for list(). So it seems like this script shouldn't be listed as being compatible with the OTB bash. Sorry for any confusion.

The easy solution would be to call it with zsh as you were originally. I changed the shebang back to zsh and updated the option to -k on read. Please pull down again and try with zsh instead of bash.

from apple-music-cli-player.

mcthomas avatar mcthomas commented on June 9, 2024

No problem, thank you so much for pointing this out to me. I can see the spacing is way off with the text. I realized this is because, iterm2 supports viu in full resolution. I just added the -b flag to forced blocks. Feel free to pull if you want that fixed, or you can try to keep the resolution and resolve the spacing yourself.

As for the blinking, I don't see this occurring in terminal.app. I will look into it.

from apple-music-cli-player.

Related Issues (7)

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.