{ "info": { "author": "CJ Harries", "author_email": "cj@wizardsoftheweb.pro", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Environment :: Console", "Environment :: X11 Applications" ], "description": "``py-rofi-bus``\n~~~~~~~~~~~~~~~\n\n.. image:: https://badge.fury.io/py/py-rofi-bus.svg\n :target: https://badge.fury.io/py/py-rofi-bus\n\n.. image:: https://travis-ci.org/thecjharries/py-rofi-bus.svg?branch=master\n :target: https://travis-ci.org/thecjharries/py-rofi-bus\n\n.. image:: https://coveralls.io/repos/github/thecjharries/py-rofi-bus/badge.svg?branch=master\n :target: https://coveralls.io/github/thecjharries/py-rofi-bus?branch=master\n\nThis package provides a DBus foundation for ``rofi``.\n\nCurrent version is a skeleton API with a simple window switcher. The API will potentially change drastically.\n\n\n\nFeatures\n--------\n\n(These are all planned; ``0.2.0`` doesn't expose much of an API)\n\n* Spawn and populate scripts/modi via ``py-rofi-bus``\n* Save information from scripts/modi\n* Split massive scripts/modi into smaller components that pass state through ``py-rofi-hub``\n\nSetup\n------------\n\nSystem Dependencies\n===================\n\n* |rofi_source|_\n* XCB Python bindings (preferably |xcffib_source|_)\n\n.. |rofi_source| replace:: The ``rofi`` utility\n.. _rofi_source: https://github.com/DaveDavenport/rofi/blob/next/INSTALL.md\n.. |xcffib_source| replace:: via ``xcffib``\n.. _xcffib_source: https://github.com/tych0/xcffib#installation\n\nInstallation\n============\n\n.. code:: shell-session\n\n $ pip install --user py-rofi-bus\n\nUsage\n-----\n\nAs of ``0.2.0``, logging and help menus are pretty sparse. Expect things to break without a clear reason.\n\n``MainDbusDaemon``\n==================\n\nThe (current) core of ``py-rofi-bus`` is ``MainDbusDaemon``, which combines all of the important features in some manner without implementing any of them very well. ``MainDbusDaemon`` forks to become a daemon and runs in the background. It publishes a very simple interface to the ``SessionBus`` and waits for interaction from the user. It currently cannot resuscitate itself should its main loop be killed or exited.\n\nCLI Interaction\n<<<<<<<<<<<<<<<\n\n``py-rofi-bus`` exposes a very simple CLI to manage ``MainDbusDaemon``.\n\n.. code:: shell-session\n\n $ which py-rofi-bus\n ~/.local/bin/py-rofi-bus\n $ py-rofi-bus daemon -h\n usage: py-rofi-bus daemon [-h] {start,status,stop} ...\n\n positional arguments:\n {start,status,stop} Available actions\n start Start the daemon\n status Check the status of the daemon\n stop Stop the daemon\n\n optional arguments:\n -h, --help show this help message and exit\n\nThe CLI is independent of the daemon so it can be used to restart the daemon.\n\nDBus Interface\n<<<<<<<<<<<<<<\n\n``start``\n>>>>>>>>>\n\nStarts the daemon. Doesn't actually do anything (except I don't think I'm properly watching the PID file so it actually just restarts the daemon).\n\n``stop``\n>>>>>>>>\n\nStops the daemon. This kills the daemon's process.\n\n``is_running``\n>>>>>>>>>>>>>>\n\n``True`` if the daemon is running; ``GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown`` if the daemon is not running.\n\n``load_apps``\n>>>>>>>>>>>>>\n\nThis is an experimental feature that attempts to run any executable found in the configured ``load_from`` directory. Files must be marked as executable for the script to be able to load them. So far my cursory tests have demonstrated an ability to load and control both simple scripts and more complicated things like daemons. They've also revealed that I should have planned a bit better and will probably face some refactoring soon.\n\n``systemd`` Integration\n<<<<<<<<<<<<<<<<<<<<<<<\n\n``MainDbusDaemon`` can easily be run as a ``user`` ``systemd`` ``unit``. First a ``target`` that binds to the ``graphical-session.target`` must be made.\n\n.. code:: shell-session\n\n $ cat $XDG_CONF_HOME/systemd/user/my-first.target\n [Unit]\n Description=Lives and dies with the graphical session\n BindsTo=graphical-session.target\n\nWe can now bind a ``unit`` to the ``target``, meaning it will also be dependent on the ``graphical-session``. Note that the paths below assume a ``--user`` install. You'll need to update them if ``py-rofi-bus`` was installed somewhere else.\n\n.. code:: shell-session\n\n $ cat $XDG_CONF_HOME/systemd/user/pyrofibus.service\n [Unit]\n Description=py-rofi-bus\n PartOf=graphical-session.target\n\n [Service]\n Type=forking\n ExecStart=%h/.local/bin/py-rofi-bus daemon start\n ExecStop=%h/.local/bin/py-rofi-bus daemon stop\n PIDFile=%h/.config/wotw/py-rofi-bus/.pid\n\n [Install]\n WantedBy=my-first.target\n\n # Start the service to make sure it works\n $ systemctl --user start pyrofibus.service\n\n # Assuming it does, you can enable it to run automatically\n $ systemctl --user enable pyrofibus.service\n\nFinally, to trigger ``my-first.target``, add these commands somewhere in your startup files. I run ``i3`` and these are executed at the end of my ``i3`` config file. The tail end of your ``.whateverrc`` file would work well too.\n\n.. code:: bash\n\n # Some of these might not be necessary. I never weeded out the duds.\n # You'll need some of these variables to be able to trigger the target.\n systemctl --user import-environment USER HOME PATH DISPLAY XAUTHORITY\n systemctl --user start my-first.target\n\nExample App\n===========\n\nI updated the proof-of-concept example. It cast some light on the package's deficiencies. Use it with a grain of salt. Many things that are manual now aren't planned to be manual forever.\n\nInitial Setup\n<<<<<<<<<<<<<\n\nAssuming you've installed ``py-rofi-bus``, you'll need to create the configuration directory.\n\n.. code:: shell-session\n\n $ mkdir -p \"$XDG_CONFIG_HOME/wotw/py-rofi-bus/{apps-enabled,pids}\"\n\nTo run the daemons, they must be in the ``load_from`` config directory, which is probably the one above unless you changed things.\n\n.. code:: shell-session\n\n $ cd path/to/repo/or/package\n $ ls -l examples/rofi-alt-tab\n total 16\n -rw-r--r--. 1 cjharries cjharries 2457 Jun 3 13:06 active_window_monitor_daemon.py\n -rw-r--r--. 1 cjharries cjharries 2231 Jun 3 13:06 dbus_window_daemon.py\n -rw-r--r--. 1 cjharries cjharries 4826 Jun 3 13:06 ordered_window_script.py\n $ chmod u+x examples/rofi-alt-tab/*.py\n $ source <(\n realpath examples/rofi-alt-tab/*daemon.py | \\\n awk '{ print \"ln -s \"$0\" $XDG_CONFIG_HOME/wotw/py-rofi-bus/apps-enabled\"; }' \\\n )\n $ ls -l ~/.config/wotw/py-rofi-bus/apps-enabled\n total 12\n lrwxrwxrwx. 1 cjharries cjharries 103 Jun 3 18:00 active_window_monitor_daemon.py -> /examples/rofi-alt-tab/active_window_monitor_daemon.py\n lrwxrwxrwx. 1 cjharries cjharries 93 Jun 3 18:00 dbus_window_daemon.py -> /examples/rofi-alt-tab/dbus_window_daemon.py\n\nIf you're not comfortable symlinking the files or don't feel like going to the trouble, you can always do a vanilla copy.\n\nYou'll also need to expose the script in some way. A generally recommended idea is to store scripts in a common location.\n\n.. code:: shell-session\n\n $ mkdir -p $XDG_CONFIG_HOME/rofi/scripts\n $ cd path/to/repo/or/package\n $ ln -s $(realpath examples/rofi-alt-tab/ordered_window_script.py) $XDG_CONFIG_HOME/rofi/scripts\n\nLaunching the Main Daemon\n<<<<<<<<<<<<<<<<<<<<<<<<<\n\nRun the following command.\n\n.. code:: shell-session\n\n $ py-rofi-bus daemon start\n\nLaunching the Example\n<<<<<<<<<<<<<<<<<<<<<\n\nOnce the files are in the ``load_from`` directory and the daemon is running, you'll have to either add another file or pop open a REPL.\n\n.. code:: shell-session\n\n $ python\n\n >>> import pydbus\n >>> bus = pydbus.SessionBus()\n >>> loader = bus.get('pro.wizardsoftheweb.pyrofibus.daemon.window_properties')\n >>> loader.load_apps()\n >>> exit()\n\nRunning the Modi\n<<<<<<<<<<<<<<<<\n\nWith the script accessible and the daemons running, you can either execute it as a one-off or add it to your configuration.\n\n.. code:: shell-session\n\n # Runs it as a one-off\n $ rofi -modi alttab:~/.config/rofi/scripts/ordered_window_script.py -show alttab\n\n # Adds it to the existing config\n $ export ROFI_CONFIG_FILE=$(rofi --help | awk 'BEGIN{ IGNORECASE = 1 };/configuration file/{ print $3; }')\n $ [ -f $ROFI_CONFIG_FILE ] || rofi -dump-config > $ROFI_CONFIG_FILE\n $ sed \\\n -i=.bak \\\n -e 's@\\([^-]modi:.*\\)\";@\\1,alttab:~/.config/rofi/scripts/ordered_window_script.py\";@g' \\\n $ROFI_CONFIG_FILE\n $ rofi -show alttab\n\nConclusion\n<<<<<<<<<<\n\nLike its predecessor, this example (and the package it's from) is still very much in its infancy. Expect things to change. This is too much work to do when Python could it for me.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/thecjharries/py-rofi-bus#readme", "keywords": "rofi,xcb", "license": "ISC", "maintainer": "", "maintainer_email": "", "name": "py-rofi-bus", "package_url": "https://pypi.org/project/py-rofi-bus/", "platform": "", "project_url": "https://pypi.org/project/py-rofi-bus/", "project_urls": { "Homepage": "https://github.com/thecjharries/py-rofi-bus#readme", "Issue Tracker": "https://github.com/thecjharries/py-rofi-bus/issues" }, "release_url": "https://pypi.org/project/py-rofi-bus/0.2.0/", "requires_dist": [ "pytest-runner", "PyGObject", "pydbus", "xcffib", "xpybutil" ], "requires_python": "", "summary": "A DBus extension for rofi", "version": "0.2.0" }, "last_serial": 3926599, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d8f17ddcb4c561c5b203ece33a40b345", "sha256": "0b23860e0fc064d4c2f7208fb4ceaf00c17855bf38749b70f755f5582a963ff7" }, "downloads": -1, "filename": "py_rofi_bus-0.0.1-py2-none-any.whl", "has_sig": false, "md5_digest": "d8f17ddcb4c561c5b203ece33a40b345", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 2392, "upload_time": "2018-06-02T10:32:04", "url": "https://files.pythonhosted.org/packages/0f/ea/db480257fcdb99608282b757cc46c9dbb18ce73e518366c37c11fcdec09c/py_rofi_bus-0.0.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78d34eedd064640262608eecdb3afa0a", "sha256": "023275193728f0d98f0187047acaa5a8de470195d79addf29fb04973d6d7567a" }, "downloads": -1, "filename": "py_rofi_bus-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "78d34eedd064640262608eecdb3afa0a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2392, "upload_time": "2018-06-02T10:32:05", "url": "https://files.pythonhosted.org/packages/d0/c0/834f74d771a69ff462b59ca57d79e19854beecd47a9b19c7ed61b532e45a/py_rofi_bus-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bb335fcb492e85a899809890c05168f9", "sha256": "c6624e5eabebc3edc8f608088e591d9c28925164fa945304e9e572a313d94060" }, "downloads": -1, "filename": "py-rofi-bus-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bb335fcb492e85a899809890c05168f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4331, "upload_time": "2018-06-02T10:37:31", "url": "https://files.pythonhosted.org/packages/84/f5/312ec4c82055005dc3716bb99612e329d3f5d3ef75d04e03f5c3cd3e81cc/py-rofi-bus-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7e7fb494e70e6e1fae6b9e71e16bcbde", "sha256": "a17e1ad3f6b8a25fc1f17efc7d2b9692faf70c13efdc517053e90540e1971988" }, "downloads": -1, "filename": "py_rofi_bus-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "7e7fb494e70e6e1fae6b9e71e16bcbde", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5274, "upload_time": "2018-06-02T10:43:15", "url": "https://files.pythonhosted.org/packages/fd/e2/95c8b329ab9ea9f9282f57dcf033557131e0be14a114f1ee732d4a0fd519/py_rofi_bus-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2682f2deaa5d5b786feb6598c7f7205", "sha256": "ba50a611d702494b0a322b5fd17ea7df5c4fe8b63d1722a581fa7012901dbfe4" }, "downloads": -1, "filename": "py_rofi_bus-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "c2682f2deaa5d5b786feb6598c7f7205", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5274, "upload_time": "2018-06-02T10:43:17", "url": "https://files.pythonhosted.org/packages/11/82/7e4a0ea0f5051fe5a2f1cc911fecec0b7f42628d4ca04ec3676a95dcbd9a/py_rofi_bus-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "674a6079bf5fadab77ab6aa1575a76f4", "sha256": "6f6e8078de27a4892425912575b1a7de6de107967fb749585bbdaab742142907" }, "downloads": -1, "filename": "py-rofi-bus-0.0.2.tar.gz", "has_sig": false, "md5_digest": "674a6079bf5fadab77ab6aa1575a76f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4357, "upload_time": "2018-06-02T10:43:18", "url": "https://files.pythonhosted.org/packages/9c/60/23f9ba5addd3eb7e0f809d713fb6e94a9ffde250cfe924811fec22e48aa8/py-rofi-bus-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "8281cd0040d5ecb3ce07aacfde4bc5ce", "sha256": "28d481934356b6ebeb9718878417419882d5e76088b17d486a751764b55962bd" }, "downloads": -1, "filename": "py_rofi_bus-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "8281cd0040d5ecb3ce07aacfde4bc5ce", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 5287, "upload_time": "2018-06-02T10:47:33", "url": "https://files.pythonhosted.org/packages/1c/45/5c514388c684e38e81dc0c0dd71f534bceea0f77cad6afd51e5d1749e8da/py_rofi_bus-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f493abe561c64d7e5c71a35ca95e04ac", "sha256": "bf1911ee8f84a0f7207f2f95add421bd753aa8a3eb3e94af7d84e2a0ccb67443" }, "downloads": -1, "filename": "py_rofi_bus-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f493abe561c64d7e5c71a35ca95e04ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5289, "upload_time": "2018-06-02T10:47:35", "url": "https://files.pythonhosted.org/packages/4d/17/72585947c4e198f84400b54ab61588406272ca6163793f65f8e400fae7d9/py_rofi_bus-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e800f3d258c641a979dd6c81c96596ca", "sha256": "56ed8fd0829268a050c68e760765e278fcb5b14a69975b7726ea1e190df44195" }, "downloads": -1, "filename": "py-rofi-bus-0.0.3.tar.gz", "has_sig": false, "md5_digest": "e800f3d258c641a979dd6c81c96596ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4381, "upload_time": "2018-06-02T10:47:36", "url": "https://files.pythonhosted.org/packages/a9/e3/332a1878aa76c61049f2c8808370a06e97c849b3c6ef1bc31cc80aa6857d/py-rofi-bus-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "147c72b4b1cf12925dcd922438f694c0", "sha256": "f1c6cb2707a30bbbc80e7d71b4c81f93f6dd777ee89886c90793a8cf20251ac7" }, "downloads": -1, "filename": "py_rofi_bus-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "147c72b4b1cf12925dcd922438f694c0", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 32735, "upload_time": "2018-06-03T03:22:08", "url": "https://files.pythonhosted.org/packages/c0/8a/87068cc41855dbdc8319e54718f0158ea54b6a6cf10369142fa2a83c2a6b/py_rofi_bus-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8162ae69558cb1d037f6ad059f0204f", "sha256": "a5d20b1d2746cbc6afd53de6f56adfc1c937c87d9d5c86f103be130a1b95e488" }, "downloads": -1, "filename": "py_rofi_bus-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b8162ae69558cb1d037f6ad059f0204f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 32734, "upload_time": "2018-06-03T03:22:10", "url": "https://files.pythonhosted.org/packages/b9/4c/c44e2c0d893904b7a7dc20dbb36f07e76cbd7bddf5bbe9d956d692e28fc5/py_rofi_bus-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dda5fca6c5ef7328afb0bd228073bc3e", "sha256": "6c03ae8ae1d55b9264cb8b85c79b38976bc15081f0d225b86bdb6e41e1d71757" }, "downloads": -1, "filename": "py-rofi-bus-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dda5fca6c5ef7328afb0bd228073bc3e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17049, "upload_time": "2018-06-03T03:22:11", "url": "https://files.pythonhosted.org/packages/d8/9f/e2ff51bc3ccb93fff0c9447800d8f86b6180522e82586244c457ec0ee820/py-rofi-bus-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "798811f5519098235caca92e1a02733a", "sha256": "fd2994023e451210153936efa433993625b845b62707e2e40eb428c2870c4bd8" }, "downloads": -1, "filename": "py_rofi_bus-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "798811f5519098235caca92e1a02733a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 42522, "upload_time": "2018-06-04T00:05:43", "url": "https://files.pythonhosted.org/packages/0a/5f/cb7302dc5e49ea9f9cfe13880902e7f8f2a963d2b1b2a11f36ffedb3c3cc/py_rofi_bus-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91e206fd6aa71675d306634d16b241e7", "sha256": "0f9348c5aa19b53181557efd1b26942dbdc4e3cdd0921377940325eba8dcca3a" }, "downloads": -1, "filename": "py_rofi_bus-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "91e206fd6aa71675d306634d16b241e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 42522, "upload_time": "2018-06-04T00:05:44", "url": "https://files.pythonhosted.org/packages/aa/8d/12878a2b8d694033d13df6f7c3cd240daddf566c70dced34f3a305167757/py_rofi_bus-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a96ba94db1aa796ed683eb4f252d8b82", "sha256": "06e205fc6af65b419d41643a89228205336fc36a52df6490fbf9ace2c6f7f327" }, "downloads": -1, "filename": "py-rofi-bus-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a96ba94db1aa796ed683eb4f252d8b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26823, "upload_time": "2018-06-04T00:05:46", "url": "https://files.pythonhosted.org/packages/26/77/107fe21ec4fba5ec9f4f5ac62e7e27c218b6cdf8b48ed9419d2a38672bfa/py-rofi-bus-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "798811f5519098235caca92e1a02733a", "sha256": "fd2994023e451210153936efa433993625b845b62707e2e40eb428c2870c4bd8" }, "downloads": -1, "filename": "py_rofi_bus-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "798811f5519098235caca92e1a02733a", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 42522, "upload_time": "2018-06-04T00:05:43", "url": "https://files.pythonhosted.org/packages/0a/5f/cb7302dc5e49ea9f9cfe13880902e7f8f2a963d2b1b2a11f36ffedb3c3cc/py_rofi_bus-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "91e206fd6aa71675d306634d16b241e7", "sha256": "0f9348c5aa19b53181557efd1b26942dbdc4e3cdd0921377940325eba8dcca3a" }, "downloads": -1, "filename": "py_rofi_bus-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "91e206fd6aa71675d306634d16b241e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 42522, "upload_time": "2018-06-04T00:05:44", "url": "https://files.pythonhosted.org/packages/aa/8d/12878a2b8d694033d13df6f7c3cd240daddf566c70dced34f3a305167757/py_rofi_bus-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a96ba94db1aa796ed683eb4f252d8b82", "sha256": "06e205fc6af65b419d41643a89228205336fc36a52df6490fbf9ace2c6f7f327" }, "downloads": -1, "filename": "py-rofi-bus-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a96ba94db1aa796ed683eb4f252d8b82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26823, "upload_time": "2018-06-04T00:05:46", "url": "https://files.pythonhosted.org/packages/26/77/107fe21ec4fba5ec9f4f5ac62e7e27c218b6cdf8b48ed9419d2a38672bfa/py-rofi-bus-0.2.0.tar.gz" } ] }