{"id":17194660,"url":"https://github.com/gtxaspec/thingino-button","last_synced_at":"2025-03-25T07:28:06.438Z","repository":{"id":251096492,"uuid":"836382893","full_name":"gtxaspec/thingino-button","owner":"gtxaspec","description":"trigger commands based on input events","archived":false,"fork":false,"pushed_at":"2024-08-31T04:24:41.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T20:40:41.793Z","etag":null,"topics":["button","button-control","evdev","ingenic","input","thingino","triggerhappy"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gtxaspec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-31T18:18:04.000Z","updated_at":"2024-08-31T04:24:45.000Z","dependencies_parsed_at":"2024-12-02T23:06:04.305Z","dependency_job_id":null,"html_url":"https://github.com/gtxaspec/thingino-button","commit_stats":null,"previous_names":["gtxaspec/thingino-button"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtxaspec%2Fthingino-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtxaspec%2Fthingino-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtxaspec%2Fthingino-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gtxaspec%2Fthingino-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gtxaspec","download_url":"https://codeload.github.com/gtxaspec/thingino-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245417433,"owners_count":20611934,"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":["button","button-control","evdev","ingenic","input","thingino","triggerhappy"],"created_at":"2024-10-15T01:47:44.380Z","updated_at":"2025-03-25T07:28:06.417Z","avatar_url":"https://github.com/gtxaspec.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thingino-Button\n\n`thingino-button` is a simple program designed to monitor input events from a specified device and execute corresponding commands based on the configuration. It is primarily aimed at embedded systems where specific actions need to be triggered by pressing, releasing, or holding buttons.\n\n## Features\n\n- Monitor an input device for key events.\n- Execute different commands on key press, release, or timed hold.\n- Configurable through a simple configuration file.\n- Supports running as a daemon or in silent mode.\n- Basic key support for `KEY_ENTER` and keys `0-9`. More keys can be easily added by modifying the source code.\n\n## Requirements\n\n- A Linux-based system with access to the input device (e.g., `/dev/input/event0`).\n\n## Installation\n\n1. **Clone the Repository:**\n   ```sh\n   git clone https://github.com/gtxaspec/thingino-button.git\n   cd thingino-button\n   ```\n\n2. **Compile the Program:**\n   To compile the program, you can use the provided Makefile. If you are cross-compiling, set the `CROSS_COMPILE` variable.\n   ```sh\n   make CROSS_COMPILE=mipsel-linux-\n   ```\n\n   This will generate the `thingino-button` executable.\n\n## Usage\n\n1. **Create a Configuration File:**\n\n   Create a file named `/etc/thingino-button.conf` with the following format:\n   ```ini\n   # Device to monitor\n   DEVICE=/dev/input/event0\n\n   # Key action mappings\n   # Format: KEY_\u003ckey_name\u003e \u003caction\u003e \u003ctime\u003e \u003ccommand\u003e\n   KEY_ENTER PRESS 0 /bin/command1\n   KEY_ENTER RELEASE 0 /bin/command2\n   KEY_ENTER TIMED 0.1 /bin/command-timed press\n   KEY_ENTER TIMED 3 /bin/command-timed\n   KEY_ENTER TIMED 5 /bin/command-timed\n   KEY_ENTER TIMED 20 /bin/command-timed\n   ```\n\n2. **Run the Program:**\n\n   You can run the program directly or with optional flags:\n   ```sh\n   ./thingino-button [-s] [-d] [input_device]\n   ```\n\n   - `-s`: Run in silent mode, logging to syslog.\n   - `-d`: Run as a daemon, logging to syslog.\n   - `input_device`: Optional input device path, overrides the config file.\n\n   Example:\n   ```sh\n   ./thingino-button -s /dev/input/event1\n   ```\n\n## Configuration File Format\n\nThe configuration file should be located at `/etc/thingino-button.conf` and follows this format:\n\n```ini\n# Device to be monitored for input events\nDEVICE=/dev/input/event0\n\n# Key action mappings\n# Format: KEY_\u003ckey_name\u003e \u003caction\u003e \u003ctime\u003e \u003ccommand\u003e\n# - \u003ckey_name\u003e: Name of the key (e.g., ENTER, 1, 2, etc.)\n# - \u003caction\u003e: Type of action (PRESS, RELEASE, TIMED, TIMED_FIRE)\n# - \u003ctime\u003e: Time in seconds for TIMED, TIMED_FIRE actions (use 0 for PRESS and RELEASE)\n# - \u003ccommand\u003e: Command to execute when the action occurs\n\n# Example mappings:\nKEY_ENTER PRESS 0 /bin/command1\nKEY_ENTER RELEASE 0 /bin/command2\nKEY_ENTER TIMED 0.1 /bin/command-timed press\nKEY_ENTER TIMED 3 /bin/command-timed\nKEY_ENTER TIMED 5 /bin/command-timed\nKEY_ENTER TIMED 20 /bin/command-timed\n```\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtxaspec%2Fthingino-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgtxaspec%2Fthingino-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgtxaspec%2Fthingino-button/lists"}