Skip to main content

bspcq, q for query

A bspc analyzer (utility for bspwm)

This is a small program that prints a user friendly, visual representation, of your current bsp tree.

The aim is to assist in using bspwm so new users have an easier time getting into tiling window managers, and have some toys to play with.

It's essentially the same as running:

bspc query -M -m <monitor-name> | jq

Except there are fewer parameters, a less complex syntax to remember and an intuitive visual.

Installation

I'd recommend just copying the script from the root of this directory, bspcq, and changing the shebang.

git clone https://github.com/aidenlangley/bspcq
mv bspcq/bspcq ~/bin/bspcq # or ~/.local/bin/bspcq
chmod +x ~/bin/bspcq

Then edit the shebang - my shebang:

#! /usr/bin/env python3.10

Your shebang might need to be be:

#! /usr/bin/env python3

Dependencies

In addition, some Python modules are required, as is xtitle.

rich

rich is responsible for the nicely formatted tree.

python -m pip install rich

xtitle

xtitle assists in getting the title name of a node/window in X.

Requires C/C++ development tools, varies by distro.

git clone https://github.com/baskerville/xtitle
cd xtitle
make && make install

I've actually included it here, under contrib, so you can just copy it to ~/bin.

Via pipx

https://pypi.org/project/bspcq/

python -m pipx install bspcq

Upgrade

python -m pipx upgrade bspcq

Usage

# Prints the full tree, including output from all monitors.
bspcq
# Provides a simpler view, perfect for finding window class names.
bspcq -s
# Grabs info on all nodes that belong to the specified domain.
bspcq -M/D/N

# For a simplified view.
bspcq -M/D/N -s
# Passes through a query to `bspc query` and prints our tree, valid identifiers
# are names, ID's or the address output by `bspc -M/D/N`.
bspcq -m/d/n <monitor/desktop/node-identifier>

Preview

2022-01-25_02-17_1

2022-01-25_02-17

Plans

My goals currently are to:

  • Align bspcq as closely as possible with bspc query. I would like for bspcq to behave almost identically to bspc query - it just adds a visual element.
  • Remain as lean as possible. A nice-to-have feature would be 0 reliance on external libraries, so I'd like to remove rich and implement a way to display the tree myself.

This was just an afternoon project that's turning into a week long project since it's quite a lot of fun!

Metadata

Release files for bspcq 0.1.58

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bspcq 0.1.58
File Size Uploaded Provenance Actions
bspcq-0.1.58.tar.gz 6.9 kB Without provenance Details for bspcq-0.1.58.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bspcq 0.1.58
File Interpreter ABI Platform Actions
bspcq-0.1.58-py3-none-any.whl Python 3 none any Details for bspcq-0.1.58-py3-none-any.whl

Total release size: 14.2 kB

Release files / bspcq-0.1.58.tar.gz

Download URL bspcq-0.1.58.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
57abb77fdeb97137f0794313fad3f658edc06c9dc8010ce34d21a93f113c4c94
BLAKE2b-256 checksum
How to use checksums
67f41c40172236275c43b69a078ce702cd0a20c4066800576fd0105be2c499ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.13

Release files / bspcq-0.1.58-py3-none-any.whl

Download URL bspcq-0.1.58-py3-none-any.whl
Size 7.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43b1c32b2e0ab285aeb0b6572edef4c0a843fe7998598d43481758ad5bf6225a
BLAKE2b-256 checksum
How to use checksums
cc25cc9f59049a5f8220424a65dcbee60f4e54a0cce5396ef9f1b7c23cdbf347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.13

Security for bspcq 0.1.58

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page