Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Do not open more than one instance of google music electron #19

Closed
AngelEzquerra opened this issue Oct 21, 2015 · 10 comments
Closed

Do not open more than one instance of google music electron #19

AngelEzquerra opened this issue Oct 21, 2015 · 10 comments

Comments

@AngelEzquerra
Copy link

Executing google music electron when it is already running should not open a new instance. Instead it should just show (unhide and bring to the front) the existing instance.

@AngelEzquerra
Copy link
Author

Also, it would be neat if you could pass an "action" should as play, plause, next and prev. In that case the window should not be shown, but the action should be performed (silently).

@twolfson
Copy link
Owner

We decide to allow multiple instances to make our life as developers easier (e.g. listen to music in one instance, reboot/dev in another). Considering this a wontfix for now.

@twolfson
Copy link
Owner

With respect to actions, those integrations can be done via something like MPRIS. Here's a CLI tool that makes calls out to MPRIS and should work:

https://github.com/acrisci/playerctl

@AngelEzquerra
Copy link
Author

I think MPRIS only works on Linux?
Also, would you consider adding a flag to avoid opening more than one instance?

@twolfson
Copy link
Owner

With respect to MPRIS, I think you are right about it being Linux only. I have a feeling there are Windows equivalents though. Worst case scenario, I would opt for an HTTP API over CLI integration (since the latter would likely need an API inevitably).

With respect to multiple instances, we will have to research if that's possible. I know nw.js had something about singleInstance -- maybe we can reproduce what they do (e.g. if they do something like find similarly named processes)

@twolfson
Copy link
Owner

It looks like this should be possible via a module named monogamous and eventually maybe electron itself:

electron/electron#648

https://github.com/mnichols/monogamous

@twolfson
Copy link
Owner

To give an ETA on this, I will try implementing this by the end of next weekend (unless someone beats me to the punch).

@twolfson
Copy link
Owner

Taking a look at building this now. Going to make single instance the default with a CLI flag/config override to enable multiple instances.

@twolfson
Copy link
Owner

This has been implemented in 2.0.0.

@AngelEzquerra
Copy link
Author

This is really neat. Thank you!!!

On Sat, Oct 24, 2015 at 6:50 AM, Todd Wolfson notifications@github.com
wrote:

Closed #19 #19.


Reply to this email directly or view it on GitHub
#19 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants