{"id":31978825,"url":"https://github.com/fin-ger/logitech-m720-config","last_synced_at":"2025-10-14T22:27:29.740Z","repository":{"id":49206539,"uuid":"81862504","full_name":"fin-ger/logitech-m720-config","owner":"fin-ger","description":"A configuration script for Logitech M720 that remaps mouse buttons (Linux)","archived":false,"fork":false,"pushed_at":"2023-02-09T16:36:27.000Z","size":63,"stargazers_count":81,"open_issues_count":6,"forks_count":7,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-05-01T13:27:45.388Z","etag":null,"topics":["gesture","hidpp","linux","logitech","m720","mapping","mouse-button","python","remap","solaar","thumb-button"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fin-ger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":"fin-ger","issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-02-13T19:27:41.000Z","updated_at":"2024-04-17T13:03:38.000Z","dependencies_parsed_at":"2022-09-01T20:35:02.404Z","dependency_job_id":null,"html_url":"https://github.com/fin-ger/logitech-m720-config","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fin-ger/logitech-m720-config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fin-ger%2Flogitech-m720-config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fin-ger%2Flogitech-m720-config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fin-ger%2Flogitech-m720-config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fin-ger%2Flogitech-m720-config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fin-ger","download_url":"https://codeload.github.com/fin-ger/logitech-m720-config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fin-ger%2Flogitech-m720-config/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279021778,"owners_count":26087056,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gesture","hidpp","linux","logitech","m720","mapping","mouse-button","python","remap","solaar","thumb-button"],"created_at":"2025-10-14T22:27:04.452Z","updated_at":"2025-10-14T22:27:29.735Z","avatar_url":"https://github.com/fin-ger.png","language":"Python","funding_links":["https://liberapay.com/fin-ger"],"categories":[],"sub_categories":[],"readme":"# Logitech M720 Button Configuration for Linux\n\nThis script can be used to configure mouse button mappings of a Logitech M720 mouse temporary.\n\nThe configuration is done via the HID++ protocol described in these documents:\n\n * [Logitech HID++2.0 Draft Specification](https://lekensteyn.nl/files/logitech/logitech_hidpp_2.0_specification_draft_2012-06-04.pdf)\n * [special keys and mouse buttons](https://lekensteyn.nl/files/logitech/x1b04_specialkeysmsebuttons.html#divertedButtonsEvent)\n\nThis script is created for personal use only and may or may not work for your device. Use at your own risk.\n\n# How to Use\n\n## Installation\n\nClone the repository and install this package with pip:\n\n```\n$ pip install --user -e /path/to/logitech-m720-config\n```\n\nThis installs `m720-config` to `~/.local/bin`.\n\n### Troubleshooting\n\nOn `ubuntu` the above installation might fail due to a different `PYTHONPATH` configuration. You may use the following *workaround* (use with caution, it is a hack!)\n\n```\n$ sudo apt-get install python3-pip\n$ cd path-to-this-repo\n$ PYTHONPATH=\"./lib\" pip3 install --user -e .\n$ pip3 install --user pyudev\n$ ~/.local/bin/m720-config\n```\n\n## Run the script\n\nThis script will map `Button 8` on the thumb button by default.\n\nRun in a terminal:\n\n```\n$ m720-config\n```\n\n\u003e Make sure `~/.local/bin` is in your `PATH` variable\n\n## Create your own configuration\n\nTweak the source code in `m720_config/__init__.py` to adjust the configuration. Specifically, the remapping is done in [line 156 of `__init__.py`](https://github.com/fin-ger/logitech-m720-config/blob/master/m720_config/__init__.py#L156).\n\n### So, how does it work?\n\nWhen running `m720-config` you get a `CID INFO` printed to the terminal which looks like this:\n\n```\n### CID INFO ###\n  CID    TID  virtual persist divert reprog fntog hotkey fkey  mouse pos group gmask      rawXY\n0x0050 0x0038 False   False   False  True   False False  False True  0   1     0b00000001 False\n0x0051 0x0039 False   False   False  True   False False  False True  0   1     0b00000001 False\n0x0052 0x003A False   True    True   True   False False  False True  0   2     0b00000011 True \n0x0053 0x003C False   True    True   True   False False  False True  0   2     0b00000011 True \n0x0056 0x003E False   True    True   True   False False  False True  0   2     0b00000011 True \n0x005B 0x003F False   True    True   True   False False  False True  0   2     0b00000011 True \n0x005D 0x0040 False   True    True   True   False False  False True  0   2     0b00000011 True \n0x00D0 0x00AD False   True    True   True   False False  False True  0   2     0b00000011 True \n0x00D7 0x00B4 True    False   True   False  False False  False False 0   3     0b00000000 True \n```\n\nA `CID` is a control-ID which identifies a mouse button. To remap a button to another button, you first have to get the control-ID of the button you aim to remap (e.g. the thumb button with CID `0xD0`) and the control-ID of the button you aim to imitate (e.g. button 8 with CID `0x53`). To map CID `0xD0` to `0x53` you now have to create a CID reporting.\n\n```python\nbuttons.set_cid_reporting (0xD0, False, False, True, True, False, False, 0x53)\n```\n\nIf you just want to remap your mouse buttons, leave the other parameters as is. You can find documentation on what the other parameters are controlling [here](https://lekensteyn.nl/files/logitech/x1b04_specialkeysmsebuttons.html#setCidReporting).\n\n### Button CID mapping\n\n| CID    | Button                 |\n|--------|------------------------|\n| `0x50` | ![](buttons/lmb.png)   |\n| `0x51` | ![](buttons/mmb.png)   |\n| `0x52` | ![](buttons/rmb.png)   |\n| `0x53` | ![](buttons/btn8.png)  |\n| `0x56` | ![](buttons/btn9.png)  |\n| `0x5B` | ![](buttons/btn6.png)  |\n| `0x5D` | ![](buttons/btn7.png)  |\n| `0xD0` | ![](buttons/thumb.png) |\n| `0xD7` | unknown                |\n\n## Check your configuration\n\nUse `xev | grep button` to monitor your changes to your mouse button mapping.\n\n# How to Get Gestures On Linux?\n\nYou can use [Easystroke](https://github.com/thjaeger/easystroke/wiki) to add gesture support to your mouse. Use the thumb button as your gesture button and the behavior should be similar to that created by Logitech Options.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffin-ger%2Flogitech-m720-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffin-ger%2Flogitech-m720-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffin-ger%2Flogitech-m720-config/lists"}