{"id":16589242,"url":"https://github.com/coldfix/cecmap","last_synced_at":"2026-04-21T06:04:07.641Z","repository":{"id":62561263,"uuid":"430500338","full_name":"coldfix/cecmap","owner":"coldfix","description":"Maps CEC events to arbitrary keybindings for controlling your raspberrypi desktop via TV remote.","archived":false,"fork":false,"pushed_at":"2022-05-18T17:51:23.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-17T15:17:57.526Z","etag":null,"topics":["cec","keybindings","raspberry-pi","raspberrypi","tv","tv-remote-control","tvremote"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coldfix.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-21T22:56:36.000Z","updated_at":"2021-11-29T00:30:56.000Z","dependencies_parsed_at":"2022-11-03T15:00:38.387Z","dependency_job_id":null,"html_url":"https://github.com/coldfix/cecmap","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldfix%2Fcecmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldfix%2Fcecmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldfix%2Fcecmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coldfix%2Fcecmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coldfix","download_url":"https://codeload.github.com/coldfix/cecmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242198726,"owners_count":20088094,"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":["cec","keybindings","raspberry-pi","raspberrypi","tv","tv-remote-control","tvremote"],"created_at":"2024-10-11T23:08:17.064Z","updated_at":"2026-04-21T06:04:07.600Z","avatar_url":"https://github.com/coldfix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"cecmap\n======\n\nMaps CEC events to arbitrary keybindings for controlling your raspberrypi desktop via TV remote.\n\n\nInstall\n-------\n\nYou can install *cecmap* as user or root:\n\n**as user:**\n\n::\n\n    pip3 install --user cecmap\n\nAlso, make sure to add ``~/.local/bin`` to your PATH.\n\n\n**as root:**\n\n::\n\n    sudo pip3 install cecmap\n\nIn order to see notifications when switching modes, it's also necessary to\nhave a notification daemon installed. I recommend ``xfce4-notifyd``::\n\n    sudo apt install xfce4-notifyd\n\nI also recommend installing an onscreen keyboard, e.g.::\n\n    sudo apt install matchbox-keyboard\n\n\nUsage\n-----\n\nLaunch::\n\n    cecmap\n\n    # or:\n\n    python -m cecmap\n\n\nRunning as service\n------------------\n\nEnable running at startup::\n\n    systemctl --user enable cecmap\n\nStart as service::\n\n    systemctl --user start cecmap\n\n\nDefault keybindings\n-------------------\n\n*cecmap* comes configured with default a *Keyboard* and *Mouse* mode to get\nyou started (see `cecmap/config/default.cfg`_). You can freely change these\nkeybindings and add or override modes using the config format, see\nConfiguration_. The default keybindings are as follows:\n\n.. list-table::\n    :header-rows: 1\n\n    * - Key\n      - *Mouse* mode\n      - *Keyboard* mode\n\n    * - 🔵 F1 blue\n      - switch mode\n      - switch mode\n    * - 🔴 F2 red\n      - launch ``matchbox-keyboard``\n      - ``\u003cWin\u003e``\n    * - 🟢 F3 green\n      - mouse wheel up\n      - launch kodi\n    * - 🟡 F4 yellow\n      - mouse wheel down\n      - launch ``chromium-browser``\n\n    * - ⬆ up\n      - move cursor up\n      - ``\u003cup\u003e``\n    * - ⬇ down\n      - move cursor down\n      - ``\u003cdown\u003e``\n    * - ⬅ left\n      - move cursor left\n      - ``\u003cleft\u003e``\n    * - ➡ right\n      - move cursor right\n      - ``\u003cright\u003e``\n\n    * - 🆗 select\n      - left click\n      - ``\u003center\u003e``\n    * - ▶ play\n      - middle click\n      - ``\u003cmedia_play_pause\u003e``\n\n    * - ⏸ pause\n      - right click\n      - ``\u003cmedia_play_pause\u003e``\n    * - ↩ exit\n      - ``\u003cesc\u003e``\n      - ``\u003cesc\u003e``\n\n\nConfiguration\n-------------\n\n*cecmap* uses a simple config format to set keycodes and keybindings. The\nconfig to be used can be specified on the command line using the ``-c\nFILE.cfg`` option. The format is as follows:\n\n.. code-block:: cfg\n\n    [keycode]\n    KEY = \u003cNUMBER\u003e\n    ...\n\n    [mode.NAME]\n    KEY = \u003ccommand\u003e [\u003cargs\u003e...]\n    ...\n\ne.g.:\n\n.. code-block:: cfg\n\n    [keycode]\n    left = 123\n    yellow = 321\n    ...\n\n    [mode.Keyboard]\n    left = key left\n    yellow = launch kodi\n    ...\n\nFor a more realistic example, see `cecmap/config/default.cfg`_.\n\nIf multiple *modes* are defined, make sure to define a keybinding that\nexecutes the ``switch`` command. This is most easily done in the special\nsection ``[mode.*]`` that can be used to define fallbacks bindings that apply\nglobally to all modes. *cecmap* will be started in the topmost declared mode, and\ncycle through modes in the order of their appearance.\n\nMultiple config files can be passed. In this case the configuration is merged\nsequentially with later files overriding earlier ones. This can be used to\ne.g. load keycodes and keybindings from different files::\n\n    cecmap \\\n        -c keycodes.cfg \\\n        -c mousemode.cfg \\\n        -c keymode.cfg\n\nIf no ``-c CONFIG`` option is passed on the command line, *cecmap* checks user\nand system, or default configuration and uses the first that exists:\n\n- ``$XDG_CONFIG_HOME/cecmap.cfg`` (defaulting to ``~/.config/cecmap.cfg``)\n- ``/etc/cecmap.cfg``\n- `cecmap/config/default.cfg`_ (distributed with the package)\n\n\n.. _cecmap/config/default.cfg: https://github.com/coldfix/cecmap/blob/main/cecmap/config/default.cfg\n\nCommands\n~~~~~~~~\n\nCurrently, the following commands are supported as right hand sides of\nkeybindings:\n\n.. list-table:: Commands\n\n    * - ``launch \u003ccommand\u003e [\u003cargs\u003e...]``\n      - Start the given program. You can use shell-like quoting to pass\n        arguments with spaces in them.\n\n    * - ``toggle \u003ccommand\u003e [\u003cargs\u003e...]``\n      - Start the given program with command line options. If we have\n        previously started the program, terminate it. Useful for commands such\n        as ``matchbox-keyboard``.\n\n    * - ``key \u003cname\u003e|\u003ckeycode\u003e|@\u003cletter\u003e``\n      - Type the specified key. For a list of key names, see Key_.\n\n    * - ``button left|middle|right|\u003cnumber\u003e``\n      - Perform a mouse click using the specified button. More button names\n        are available, see Button_.\n\n    * - ``scroll up|down|left|right [\u003cticks\u003e]``\n      - Scroll the mouse wheel in the specified direction a specified number\n        of scroll ticks (default = 1).\n\n    * - ``motion up|down|left|right``\n      - Perform a mouse cursor motion along the given direction while the key\n        is pressed.\n\n    * - ``switch [\u003cmode\u003e]``\n      - Switch to the specified ``\u003cmode\u003e``, or if this optional argument is\n        omitted, cycle through modes in the order of their appearance in the\n        config files.\n\n.. _Key: https://pynput.readthedocs.io/en/latest/keyboard.html#pynput.keyboard.Key\n.. _Button: https://github.com/moses-palmer/pynput/blob/master/lib/pynput/mouse/_xorg.py\n\n\nKeycodes\n~~~~~~~~\n\nIf the default keycodes do not work as expected, you can configure the\nkeycodes specific to your setting. In order to determine which key corresponds\nto which keycode, open a terminal and execute::\n\n    cec-client\n\nWatch the output as you press buttons, and write down the keycodes for the\nconfig file.\n\n\nReloading\n~~~~~~~~~\n\n*cecmap* can be told to reload the config by sending ``SIGUSR1``, e.g.::\n\n    pkill -USR1 cecmap\n\nor, if started as a service::\n\n    systemctl --user reload cecmap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldfix%2Fcecmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoldfix%2Fcecmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoldfix%2Fcecmap/lists"}