{"id":19401230,"url":"https://github.com/mishamyrt/runon","last_synced_at":"2026-05-16T15:02:59.859Z","repository":{"id":207825627,"uuid":"720195617","full_name":"mishamyrt/runon","owner":"mishamyrt","description":"🔥 A utility for running commands on macOS system events","archived":false,"fork":false,"pushed_at":"2024-08-11T14:44:22.000Z","size":131,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T23:42:34.365Z","etag":null,"topics":["daemon","macos","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/mishamyrt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-11-17T19:44:20.000Z","updated_at":"2025-01-13T14:06:07.000Z","dependencies_parsed_at":"2024-01-13T07:22:53.362Z","dependency_job_id":"715d71f8-d0c3-47f2-81dc-23d6e205e413","html_url":"https://github.com/mishamyrt/runon","commit_stats":{"total_commits":60,"total_committers":1,"mean_commits":60.0,"dds":0.0,"last_synced_commit":"be0fcb22008d1af3260fd891b70b00a768a77885"},"previous_names":["mishamyrt/runif","mishamyrt/runon"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/mishamyrt/runon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Frunon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Frunon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Frunon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Frunon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mishamyrt","download_url":"https://codeload.github.com/mishamyrt/runon/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mishamyrt%2Frunon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33107564,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["daemon","macos","swift"],"created_at":"2024-11-10T11:17:37.873Z","updated_at":"2026-05-16T15:02:59.842Z","avatar_url":"https://github.com/mishamyrt.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./assets/logo.svg\" alt=\"RunOn logo\" /\u003e\n\u003c/p\u003e\n\n[![Quality Assurance](https://github.com/mishamyrt/runon/actions/workflows/qa.yaml/badge.svg)](https://github.com/mishamyrt/runon/actions/workflows/qa.yaml) [![Version](https://img.shields.io/github/v/tag/mishamyrt/runon?sort=semver)](https://github.com/mishamyrt/nuga-lib/tags)\n\nRunOn is a utility for running commands on macOS system events.\n\n## Installation\n\n### Script\n\nThe easiest way is to use an installation script. To install using the script, run the command:\n\n```sh\ncurl -skSfL https://raw.githubusercontent.com/mishamyrt/runon/main/scripts/install.sh | bash\n```\n\nThis command will download and run the [installation script](./scripts/install.sh).\n\n### Build from source\n\nBuilding the project is currently only possible on macOS. Swift 5.10 is required for the build.\n\n```sh\n# Build the project from source code\nmake build\n# Install runon to the system\nsudo make install\n```\n\n## Configuration\n\nTo print the configuration file path, run the command:\n\n```sh\nrunon config-path\n```\n\nThe configuration is described in the format:\n\n\u003e When `SOURCE` emits an `EVENT` [with `DATA`] execute a `COMMAND`\n\nExample:\n\n```yaml\nactions:\n  # If my work monitor is connected, turn on the desk backlight\n  - on: screen:connected\n    with: Mi 27 NU\n    run: myrt_desk on# If the monitor is disconnected, turn off the desk backlight\n  - on: screen:disconnected\n    with: Mi 27 NU\n    run: myrt_desk off\n```\n\nIf you want to run a command on an event, regardless of the input (`with`), then use the simplified notation:\n\n```yaml\nactions:\n  # If any monitor is disconnected, set brightness to 60%\n  - on: screen:disconnected\n    run: lunar set 60\n```\n\nExecution of commands is time-limited. The default maximum time is 30 seconds. It can be set for each command separately.\n\n```yaml\nactions:\n  # the process will be terminated in 20 seconds\n  - on: screen:disconnected\n    run: sleep 30\n    timeout: 20s\n```\n\nTo execute multiple commands sequentially, describe them in a multiline string, as in the script:\n\n```yaml\nactions:\n  - on: screen:connected\n    run: |\n      setup_audio\n      desk_lights on\n```\n\nMultiple sources or target events can be specified in a similar way:\n\n```yaml\nactions:\n  - on: |\n      screen:connected\n      screen:disconnected\n    with: |\n      Mi 27 NU\n      ROG 32U\n    run: echo 'display changed'\n```\n\n### Groups\n\nSeveral actions can be combined into groups. Within a group, you can set a minimum interval between two actions.\n\n```yaml\nactions:\n  - on: screen:connected\n    with: Mi 27 NU\n    run: myrt_desk on\n    group: desk\n  - on: screen:disconnected\n    with: Mi 27 NU\n    run: myrt_desk off\n    group: desk\n\ngroups:\n  # avoid flickering\n  - name: desk\n    debounce: 5s\n```\n\n## Event sources\n\nThe following event sources can be subscribed to:\n\n- `screen` — connected displays list change. declares `connected`, `disconnected`, `locked` and `unlocked` events. In `with` takes the display name.\n- `audio` — connected audio device list change. declares `connected` and `disconnected` events. In `with` takes the audio device name. Handles both input and output devices.\n- `app` — active application change. declares `activated`, `deactivated`, `launched` and `terminated` events. In `with` takes the app bundle identifier (like `com.microsoft.VSCode`). If the application does not have a bundleID, the name of the executable will be used as the fallback. To see which event the application emits, use the `runon print` command.\n\n## Usage\n\n### Service\n\nThe background service can be started and stopped with the `runon` command.\n\n```sh\nrunon start # starts the service\nrunon stop # stops the service\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Frunon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmishamyrt%2Frunon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmishamyrt%2Frunon/lists"}