Skip to content
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

Ability to control playback with command-line flags #377

Open
Underpath opened this issue Apr 29, 2024 · 4 comments
Open

Ability to control playback with command-line flags #377

Underpath opened this issue Apr 29, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Underpath
Copy link

Currently, it is possible to control playback using the standard media keys on keyboard (forward, play/pause, etc.). For added flexibility I would love to have additional ways to controlling playback through one of these options:

  1. Applescript. Other media players can take commands this way, for example:
    tell application "Spotify" to playpause
  2. Command line. Other media players can take commands this way, for example:
    clementine --play-pause
  3. Custom global shortcuts, see options from Strawberry player:
    image

Enabling any of these options would allow for the player to be controlled through automations and scripts. Currently I'm unable to reliably do this because the media keys in macOS control all media, so watching a Youtube video in a browser hijacks them even when I only want to control my music player.

@Underpath
Copy link
Author

Had a look at the code and unfortunately I'm not knowledgeable in Go so I couldn't find a way to fix this myself. Seems option 2 would be the most viable.

Global shortcuts are not supported in fyne so something like this would be needed for option 3: https://github.com/golang-design/hotkey

@dweymouth
Copy link
Owner

dweymouth commented Apr 29, 2024

Command-line arguments would certainly be the easiest to add, but I have a feeling like they might only be useful on Linux? On Windows, a GUI app actually cannot access command-line arguments (yes it's a very weird choice by Microsoft). And on Mac, they can, but you have to use the full path to the binary inside of the .app bundle, AFAIK. Do you know how other GUI apps on Mac that also accept CLI arguments set it up?

Edit: on Windows it's actually that a GUI app can't attach to a console, which is a bit different

@Underpath
Copy link
Author

Both Clementine and Strawberry have very similar implementations, not surprising given Strawberry is a fork of Clementine:

Interesting to know the limitation on Windows, but for macOS I don't think that's much of a problem, using the full path to the binary seems easy enough to me.

@xisonc
Copy link

xisonc commented May 3, 2024

I'd also like to see this, then I can bind my own keyboard shortcuts and also programmatically control playback.

For instance on my laptop I have a custom script that runs to pause my music when I lock my screen. This currently is not possible with supersonic, but I used regularly with Clementine/Strawberry.

@dweymouth dweymouth changed the title Additional playback controls Ability to control playback with command-line flags May 4, 2024
@dweymouth dweymouth added the enhancement New feature or request label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants