[Feature Request] Run OpenRGB as a singleton by default

This was originally incorrectly a bug report and has been updated to a feature request.

Description of Feature Request

Multiple instances of OpenRGB can be run at the same time. Many applications enforce singletons to reduce complexity. Can OpenRGB?

This creates a problem because the first instance gets control of all hardware, so other instances cannot control any devices. Yes, sure, "Don't run it again!", but... here we are 😆

Reproduce

1. Start OpenRGB, load a profile. 2. Minimize it to the systray. 3. Wait until you forget about it. 4. Start a second OpenRG instance. All supported devices are detected, but no color changes work (at least with my hardware on Linux, YMMV?)

  1. Start OpenRGB
  2. Second a second OpenRGB.

Potential Solution

Create a PID Lockfile to ensure a singleton. Reference: StackOverflow - How to create a single instance application in C or C++. Second instances would ideally exit with an error modal, then set mouse focus to the original instance.

Consider a --allow-multiple-instances flag if there are intended use cases for multiple instances.

Edited by Brad Erickson