{"id":13674567,"url":"https://github.com/edrd-f/xmg","last_synced_at":"2025-04-28T14:31:31.794Z","repository":{"id":218087004,"uuid":"340260232","full_name":"edrd-f/xmg","owner":"edrd-f","description":"Linux/X11 tool for intercepting mouse events and executing commands. Written in Kotlin Native.","archived":false,"fork":false,"pushed_at":"2021-09-06T12:56:01.000Z","size":169,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-11T14:42:20.478Z","etag":null,"topics":["kotlin-native","linux","x11"],"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/edrd-f.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":"2021-02-19T04:42:01.000Z","updated_at":"2024-10-29T18:28:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"07d287f1-9c12-4d5b-b06d-7f7c0696038f","html_url":"https://github.com/edrd-f/xmg","commit_stats":null,"previous_names":["edrd-f/xmg"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrd-f%2Fxmg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrd-f%2Fxmg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrd-f%2Fxmg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edrd-f%2Fxmg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edrd-f","download_url":"https://codeload.github.com/edrd-f/xmg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251330289,"owners_count":21572261,"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":["kotlin-native","linux","x11"],"created_at":"2024-08-02T11:00:53.845Z","updated_at":"2025-04-28T14:31:31.772Z","avatar_url":"https://github.com/edrd-f.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# XMG\n\nXMG (X11 Mouse Grabber) is a Linux/X11 tool for intercepting mouse\nbutton press events and triggering actions.\n\nIt's a way of making use of the extra mouse buttons when the manufacturer\ndoes not provide Linux drivers and/or tools for configuring button actions\n(which means 99.9% of the cases).\n\n## Installation\n\n1. Install [libxcb](https://xcb.freedesktop.org/). In most distributions\nit's possible to install it through the package manager.\n\n2. Download the [latest release](https://github.com/edrd-f/xmg/releases) and\n\t place it under `/usr/local/bin` or other executable location.\n\n3. Create a [configuration file](#configuration).\n\n4. Execute `xmg` passing as argument the relative or absolute path to the\n\t configuration file. For example:\n\n    ```sh\n    xmg ~/.config/xmg.toml\n    ```\n\n5. (optional) Create an autostart configuration. For KDE environments, this\ncan be a simple script in `~/.config/autostart-scripts`.\n\n## Configuration\n\nConfiguration files are written in [TOML](https://toml.io/en/) format. The following example describes all supported options:\n\n```toml\nversion = 1\n\n[[mappings]]\n  button = 8\n  command = '''\n    qdbus org.kde.kglobalaccel\n      /component/kwin invokeShortcut \"ExposeAll\"\n  '''\n\n[[mappings]]\n  button = 9\n  command = '''\n    dbus-send\n      --type=method_call\n      --dest=org.mpris.MediaPlayer2.spotify\n      /org/mpris/MediaPlayer2\n      org.mpris.MediaPlayer2.Player.PlayPause\n  '''\n```\n\nYou can find out the button numbers by using `xinput`, from `xorg-xinput` package:\n\n```sh\nxinput test-xi2 --root | grep -A 10 ButtonPress\n```\n\nThe number after `detail` is the button number.\n\n## Debugging\n\nYou can check XMG is receiving mouse events correctly by looking at debug logs. To activate them, set the `LogLevel` environment variable to `debug`:\n\n```sh\nLogLevel=debug xmg config.toml\n```\n\n## Future ideas\n\n* Configurations per application\n* Long press actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedrd-f%2Fxmg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedrd-f%2Fxmg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedrd-f%2Fxmg/lists"}