{"id":17197193,"url":"https://github.com/thomaslevesque/solo","last_synced_at":"2025-03-25T08:28:42.973Z","repository":{"id":214824038,"uuid":"737449613","full_name":"thomaslevesque/Solo","owner":"thomaslevesque","description":"Simple library to run app as single-instance and notify the existing instance, if any.","archived":false,"fork":false,"pushed_at":"2024-02-20T16:22:40.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-30T07:43:20.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomaslevesque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-31T04:25:30.000Z","updated_at":"2024-01-02T16:54:21.000Z","dependencies_parsed_at":"2023-12-31T05:22:24.105Z","dependency_job_id":"da89c1bb-b6d8-4167-a185-0b8f627d5822","html_url":"https://github.com/thomaslevesque/Solo","commit_stats":null,"previous_names":["thomaslevesque/solo"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaslevesque%2FSolo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaslevesque%2FSolo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaslevesque%2FSolo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaslevesque%2FSolo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomaslevesque","download_url":"https://codeload.github.com/thomaslevesque/Solo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245425514,"owners_count":20613178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T01:55:45.861Z","updated_at":"2025-03-25T08:28:42.940Z","avatar_url":"https://github.com/thomaslevesque.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solo\n\n\u003e [!WARNING]\n\u003e This library is a work in progress, and might not work as intended. In particular, it hasn't been tested _at all_ on Linux yet.\n\nA simple library to run a .NET app as single-instance and notify the existing instance, if any.\n\nWhen the first instance of the app starts, it attempts to create a named pipe.\n- If the named pipe already exists, it means another instance of the app already exists. Solo then connects to the existing named pipe, and sends the arguments to the existing instance, so that it can react appropriately.\n- If it doesn't, the app can start normally. Solo waits for connections from other instances to receive their arguments.\n\nAdditionally, on Windows only, the new instance allows the existing instance to set the foreground window. This is necessary because of the [rules](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindow#remarks) to prevent windows from stealing focus: without this, the existing instance could react when a new instance is started, but it would stay in the background, which would lead to a poor user experience.\n\n## Getting started\n\nInstall the package, and add this at the beginning of your `Main` method (or directly in `Program.cs`, if using top-level statements):\n\n```csharp\nusing var singleInstanceApp = new SingleInstanceApp(\n    \"MyTestApp\",\n    args =\u003e Console.WriteLine(\"New instance started!\"));\nif (!singleInstanceApp.TryStart(args))\n{\n    return;\n}\n\n// The rest of your code goes here\n```\n\nThe delegate passed to the `SingleInstanceApp` constructor is invoked when another instance of the app is started.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaslevesque%2Fsolo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomaslevesque%2Fsolo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaslevesque%2Fsolo/lists"}