Name | bspcpy JSON |
Version |
1.0.3.1
JSON |
| download |
home_page | https://github.com/AlanJs26/bspcpy |
Summary | bspc wrapper for python |
upload_time | 2023-06-08 01:35:22 |
maintainer | |
docs_url | None |
author | AlanJS26 |
requires_python | >=3.10 |
license | MIT License Copyright (c) 2018 Alan José Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
python
bspwm
bspc
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# bspcpy
> It's a wrapper for the bspwm command line utility `bspc`.
bspwm is an awesome tiling window manager with a bunch of features, but when I need to develop some script that is a bit more advanced, there are not many options other than using a bash script ~~(which I hate)~~. So, to address this problem, I wrote this simple API.
## Usage
Since everything has the same names as the original bspc, It should be very easy to use.
For now, I have only implemented the query commands
```python
nodes(selector: str) -> Node_set()
desktops(selector: str) -> set[Desktop]
monitors(selector: str) -> set[Monitor]
```
and the classes that represent nodes, desktops, and monitors.
All query methods return Python sets, so it is possible to filter the nodes using set notation.
```python
from bspc import query
floating_nodes = query.nodes('.floating')
for node in floating_nodes:
if 'firefox' in node.name:
node.layout = 'tiled'
```
> This snippet finds all floating Firefox windows and puts them in tiled layout.
I wrote an implementation of a scratchpad using bspcpy in the `examples` folder.
## Requirements
- [xwininfo](https://archlinux.org/packages/extra/x86_64/xorg-xwininfo/)
## Installation
### Via pip
```bash
python -m pip install bspcpy
```
### Upgrade
```bash
python -m pip install --upgrade bspcpy
```
Raw data
{
"_id": null,
"home_page": "https://github.com/AlanJs26/bspcpy",
"name": "bspcpy",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "",
"keywords": "python,bspwm,bspc",
"author": "AlanJS26",
"author_email": "AlanJS26 <alanjoses.29@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c9/c4/5844b971ab93bdb49acbb790817d86ae8204c446dbc304eb0e9ed8750bb6/bspcpy-1.0.3.1.tar.gz",
"platform": null,
"description": "# bspcpy\n\n> It's a wrapper for the bspwm command line utility `bspc`.\n\nbspwm is an awesome tiling window manager with a bunch of features, but when I need to develop some script that is a bit more advanced, there are not many options other than using a bash script ~~(which I hate)~~. So, to address this problem, I wrote this simple API.\n\n## Usage\n\nSince everything has the same names as the original bspc, It should be very easy to use.\n\nFor now, I have only implemented the query commands\n\n```python\nnodes(selector: str) -> Node_set()\ndesktops(selector: str) -> set[Desktop]\nmonitors(selector: str) -> set[Monitor]\n```\n\nand the classes that represent nodes, desktops, and monitors.\n\nAll query methods return Python sets, so it is possible to filter the nodes using set notation.\n\n```python\nfrom bspc import query\n\nfloating_nodes = query.nodes('.floating')\n\nfor node in floating_nodes:\n if 'firefox' in node.name: \n node.layout = 'tiled'\n```\n\n> This snippet finds all floating Firefox windows and puts them in tiled layout.\n\nI wrote an implementation of a scratchpad using bspcpy in the `examples` folder.\n\n## Requirements\n\n- [xwininfo](https://archlinux.org/packages/extra/x86_64/xorg-xwininfo/)\n\n## Installation\n\n### Via pip\n\n```bash\npython -m pip install bspcpy\n```\n\n### Upgrade \n\n```bash\npython -m pip install --upgrade bspcpy\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2018 Alan Jos\u00e9 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "bspc wrapper for python",
"version": "1.0.3.1",
"project_urls": {
"Homepage": "https://github.com/AlanJs26/bspcpy"
},
"split_keywords": [
"python",
"bspwm",
"bspc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f96b21ed27cf9c93019a8ce42065c58994c9f878c83e2f5e7c6c60c4357928f6",
"md5": "51becfa2b308e8cbfa2d5ae7100fd1ff",
"sha256": "46e17887d3669fb979315e848c1a6af87472f6b2a3cadf0eb374b0eca61dd1e8"
},
"downloads": -1,
"filename": "bspcpy-1.0.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "51becfa2b308e8cbfa2d5ae7100fd1ff",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6808,
"upload_time": "2023-06-08T01:35:20",
"upload_time_iso_8601": "2023-06-08T01:35:20.146553Z",
"url": "https://files.pythonhosted.org/packages/f9/6b/21ed27cf9c93019a8ce42065c58994c9f878c83e2f5e7c6c60c4357928f6/bspcpy-1.0.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c9c45844b971ab93bdb49acbb790817d86ae8204c446dbc304eb0e9ed8750bb6",
"md5": "61d8bc77349227366931e2b07ac8ae5d",
"sha256": "fcd02b7894ddb9dbca16f4a6f957b86e772a9b548a1479f5816ecf7ab54b529a"
},
"downloads": -1,
"filename": "bspcpy-1.0.3.1.tar.gz",
"has_sig": false,
"md5_digest": "61d8bc77349227366931e2b07ac8ae5d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5943,
"upload_time": "2023-06-08T01:35:22",
"upload_time_iso_8601": "2023-06-08T01:35:22.829220Z",
"url": "https://files.pythonhosted.org/packages/c9/c4/5844b971ab93bdb49acbb790817d86ae8204c446dbc304eb0e9ed8750bb6/bspcpy-1.0.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-08 01:35:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AlanJs26",
"github_project": "bspcpy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "bspcpy"
}