{ "info": { "author": "Rapha\u00ebl Barrois", "author_email": "raphael.barrois+inputexec@polytechnique.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: No Input/Output (Daemon)", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Topic :: Utilities" ], "description": "inputexec\n=========\n\nThis program aims to handle button/command binding for headless hosts.\nIt captures all events from an input device (keyboard, mouse, etc.) and runs commands appropriately.\n\ninputexec was born from the need to pass key presses from a remote control to a Music Player Daemon.\n\n\nExample usage:\n\n.. code-block:: sh\n\n inputexec --action-commands=actions.ini --source-file=/dev/input/keyboard\n\nThe ``--action-commands`` file contains action to map to each keypress:\n\n.. code-block:: ini\n\n [commands]\n keypress.KEY_PLAYPAUSE = mpc toggle\n keypress.KEY_PREVIOUSSONG = mpc prev\n keypress.KEY_NEXTSONG = mpc next\n keypress.KEY_STOPCD = mpc stop\n\n\nInstallation\n------------\n\ninputexec is distributed under the 2-clause BSD license, and needs Python 2.6-3.3\n\nDistribution packages (recommended)\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nUse distribution-specific packages if they are available.\nThe author knows of the following options:\n\n* None yet\n\n\nFrom PyPI, the Python package index\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nSimply run:\n\n.. code-block:: sh\n\n pip install inputexec\n\n\nFrom source\n\"\"\"\"\"\"\"\"\"\"\"\n\nYou'll need the python-evdev_ library, available from PyPI (https://pypi.python.org/pypi/evdev).\n\nThen, run:\n\n.. code-block:: sh\n\n git clone https://github.com/rbarrois/evdev.git\n\n\nLauncing and configuration\n--------------------------\n\ninputexec uses only optional arguments; the full list is available through ``inputexec --help``.\n\nAll options may also been read from a configuration file passed as ``inputexec --config /path/to/example.ini``.\nThe list of valid options for the configuration files are available through ``inputexec --dump-config``.\n\n\nConfiguring actions\n-------------------\n\nFinding the symbol associated with each key press may be complicated; to solve that problem,\ninputexec can run in ``print`` mode:\n\n.. code-block:: sh\n\n inputexec --source-file=/dev/input/event0 --action-mode=print\n\n\nNow, each keypress will be displayed on stdout:\n\n.. code-block:: ini\n\n keypress.KEY_PLAYPAUSE\n keypress.KEY_PREVIOUSSONG\n keypress.KEY_NEXTSONG\n keypress.KEY_STOPCD\n\n\nExecuting actions\n-----------------\n\nThree action modes are available, configured through ``--action-mode``:\n\n* ``print``: described above, simply print event lines to stdout\n* ``run_sync``: whenever an event occurs, the related command is called;\n this blocks the program\n* ``run_async``: One or more threads are started (the number is defined by\n ``--action-jobs``) and commands to run are dispatched between those threads.\n\n\nInput\n-----\n\ninputexec can read from stdin, from a file or from a character device.\n\nFor stdin, simply pass ``--source-file=-``\n\nIf another file path is provided, inputexec will look at its type and,\nif the file is a device node with major 13 (i.e an input device on linux),\nuse the ``evdev`` reader.\nA linux input device can be opened either in ``shared`` mode\n(events are propagated to all other readers) or in ``exclusive`` mode;\nthis behaviour is controlled by the ``--source-mode=exclusive|shared`` flag.\n\nOtherwise, events will be generated from the lines of the file.\n\n\nLogging and debug\n-----------------\n\ninputexec provides a few options for logging, controlled by the ``--logging-target`` flag:\n\nSyslog\n With ``--logging-target=syslog``, all messages are sent to syslog\n\nstderr\n With ``--logging-target=stderr``, data is written to stderr\n\nfile\n With ``--logging-target=file --logging-file=FILE``, logs are appended to FILE\n\n\nLogging verbosity can be adjusted through ``--logging-level=``.\nThe ``--traceback`` option enables dumping full (Python) stack upon exceptions.\n\n\nRunning as non-root daemon\n--------------------------\n\nBy default, input devices in ``/dev/input`` can only be accessed by ``root:root``.\n\nUsers are advised to setup a dedicated user/group for inputexec, and to give\nread/write to the target device to that user.\n\nGiving access to the device is often a ``udev`` configuration task.\n\nFirst, find the ID of your device; look at ``/dev/input/by-id`` and ``/dev/input/by-path``,\nwhich provide stabler names than ``/dev/input/event3``.\n\nOnce you've found your device (you may also look at ``lsusb``, kernel logs when plugging/unplugging, etc.),\nyou'll need some rules for udev to find it:\n\n.. code-block:: sh\n\n $ udevadm info --attribute-walk --name=/dev/input/by-id/usb-13ec_0006-event-kbd\n\nYou'll get lots of lines, focus on the 2-3 first blocks, and try to find attributes\nspecific to your device; for me, this was::\n\n SUBSYSTEMS==\"input\"\n ATTRS{idVendor}==\"13ec\"\n ATTRS{idProduct}==\"0006\"\n\n\nYou can now write the udev rule, for instance into ``/etc/udev/rules.d/80_setup_inputexec.rules``:\n\n.. code-block:: sh\n\n # Include the matching attributes first (with ==), then force mode and group.\n SUBSYSTEM==\"input\", ATTRS{idVendor}==\"13ec\", ATTRS{idProduct}==\"0006\", MODE=\"660\", GROUP=\"rcinput\"\n\nNow, unplug/replug your device and check that permissions on the target ``/dev/input/eventX``\nmatch your expectations.\n\n\nContributing, reporting issues\n------------------------------\n\nIf you find an issue or have suggestions for improvements, feel free to contact me:\n\n* Open an issue on `GitHub `_\n* Send me an email at raphael.barrois+inputexec@polytechnique.org\n* Ping me on IRC, I'm Xelnor on irc.freenode.net\n\n\nTODO\n----\n\nThis section lists features, improvements and other ideas to implement.\n\n* Port to BSD kernel\n* Add exhaustive unit testing\n* Write man page and init.d service definitions\n\n\nLinks\n-----\n\nSource code and issues:\n https://github.com/rbarrois/inputexec\n\nPyPI:\n http://pypi.python.org/pypi/inputexec\n\nDocumentation:\n http://inputexec.readthedocs.org/en/latest (not yet)\n\n\n.. _python-evdev: http://pythonhosted.org/evdev/\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/rbarrois/inputexec", "keywords": "input,exec,command,evdev,event", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "inputexec", "package_url": "https://pypi.org/project/inputexec/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/inputexec/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/rbarrois/inputexec" }, "release_url": "https://pypi.org/project/inputexec/0.2.4/", "requires_dist": null, "requires_python": null, "summary": "Simple Python program to execute commands on keypress on headless systems", "version": "0.2.4" }, "last_serial": 840099, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "b56c29399e64e399930102fcbcc1c385", "sha256": "d5ad8bbeb38a0b938c8c6a089d0bc922cf41bef4497bf59fb2cc4d39141ea43a" }, "downloads": -1, "filename": "inputexec-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b56c29399e64e399930102fcbcc1c385", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10468, "upload_time": "2013-07-19T19:24:19", "url": "https://files.pythonhosted.org/packages/ef/22/7e44c069e0c28e210dd748312537b934b839d77068d63811f511183f4a3d/inputexec-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "3eca8778617a03e5f590994141826a76", "sha256": "3d859749d5f00e488bd01af1319043c6fb996b7600a907dc4a9c1c186b2a2ac5" }, "downloads": -1, "filename": "inputexec-0.2.1.tar.gz", "has_sig": false, "md5_digest": "3eca8778617a03e5f590994141826a76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10543, "upload_time": "2013-07-19T19:57:31", "url": "https://files.pythonhosted.org/packages/83/d0/1b326e655a549b77482b8578a8bd6e450e4b24f21588741be61b611b9841/inputexec-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "c0b1dcdc5458725a600757b4d2593a83", "sha256": "79d695f808dab38a4704695f699019d6e192c4d9d04c7a4a892efe53330df520" }, "downloads": -1, "filename": "inputexec-0.2.2.tar.gz", "has_sig": false, "md5_digest": "c0b1dcdc5458725a600757b4d2593a83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10547, "upload_time": "2013-07-19T20:01:37", "url": "https://files.pythonhosted.org/packages/0e/5f/91b6f21ef0c2dc75bc97fb1051a8bed7dd4ff6f73bde481fdceb99b6a055/inputexec-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "8a1cffbca460c42b38db1dfe4fc0f2af", "sha256": "92f3b4dad22eef05eae23fce5a944665b47fc383bec2a9d22bbe0f6da98bd006" }, "downloads": -1, "filename": "inputexec-0.2.3.tar.gz", "has_sig": false, "md5_digest": "8a1cffbca460c42b38db1dfe4fc0f2af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10709, "upload_time": "2013-07-19T20:27:50", "url": "https://files.pythonhosted.org/packages/5f/81/babbaa7ead7d58c7a3e1b7aab2a359edcc5c0b3567097e3d7eda7277dbb5/inputexec-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "8a186862a2e6f63f2dd6273dccf59b77", "sha256": "92c0a4f2f3b3037c39d0ae8c296423dd0e0affb40014a9e70f47199eaee540df" }, "downloads": -1, "filename": "inputexec-0.2.4.tar.gz", "has_sig": false, "md5_digest": "8a186862a2e6f63f2dd6273dccf59b77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12788, "upload_time": "2013-08-14T16:08:31", "url": "https://files.pythonhosted.org/packages/16/1b/4e0d26d90150cc05d585a0c9dc19f4d1e0a603dcef91a227feaf4807f151/inputexec-0.2.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8a186862a2e6f63f2dd6273dccf59b77", "sha256": "92c0a4f2f3b3037c39d0ae8c296423dd0e0affb40014a9e70f47199eaee540df" }, "downloads": -1, "filename": "inputexec-0.2.4.tar.gz", "has_sig": false, "md5_digest": "8a186862a2e6f63f2dd6273dccf59b77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12788, "upload_time": "2013-08-14T16:08:31", "url": "https://files.pythonhosted.org/packages/16/1b/4e0d26d90150cc05d585a0c9dc19f4d1e0a603dcef91a227feaf4807f151/inputexec-0.2.4.tar.gz" } ] }