Skip to main content

BSPHUD

Desktop switcher popup for bspwm.

BSPHUD screenshot

BSPHUD is a window that pops up in the middle of your screen and gives an overview of the desktops on the currently focused monitor. Each desktop is represented by a black box. If the box is filled, there are windows on that desktop. The box with a ring around it is the currently focused desktop.

The idea is that you bind BSPHUD to the modifier key (not a combination; the modifier key itself) that you normally use for window management hotkeys, so that BSPHUD pops up right before you're about to switch to a different desktop, send a window to a different monitor, etc.

Installation

You can install through pip, Python's package manager:

pip install bsphud

And then launch BSPHUD like so:

bsphud

or

python -m bsphud

Or you can simply copy src/bsphud/bsphud.py to a safe location and run it with Python:

python bsphud.py

Or you can even just run it directly:

./bsphud.py

BSPHUD has no dependencies except for Python and Tkinter. Tkinter is usually included with Python, but sometimes it's not, for example on minimal systems or if you compiled Python yourself and didn't explicitly enable Tkinter.

If you're on Alpine linux, tkinter can be installed with apk add python3-tkinter.

Configuration

BSPHUD will pop up when you send it SIGUSR1 and close when you send it SIGUSR2. Sending SIGUSR1 when the window is already open will cause BSPHUD to refresh the state of the desktop. BSPHUD writes its pid to /tmp/bsphud.pid.

Below is an example configuration with sxhkd:

# Show BSPHUD when left super is held down
Super_L + any
	kill -10 $(cat /tmp/bsphud.pid)

# Hide BSPHUD when left super is released
@Super_L + any
	kill -12 $(cat /tmp/bsphud.pid)

# If you have something like this
# (a shortcut to reload sxhkd),
# it is wise to add a delay before sending the signal,
# to prevent sxhkd from locking up
super + @Escape
	sleep 1; pkill -USR1 -x sxhkd ; notify-send sxhkd reloaded

# Any shortcuts that change 
# desktops/windows need to also send SIGUSR1
# in order to keep the BSPHUD display
# up to date with the state of the window manager

# super + <number> to switch to that desktop
# and super + shift + <number> to move window to that desktop
super + {_,shift + }{1-9,0}
	bspc {desktop -f,node -d} 'focused:^{1-9,10}' --follow; kill -10 $(cat /tmp/bsphud.pid)

# super + comma and super + period to cycle monitors
super + {_,shift} + {comma,period}
	bspc {monitor -f, node -m} {prev,next} --follow; kill -10 $(cat /tmp/bsphud.pid)

Misc notes

  • there needs to be a rule that tells bspwm to not manage the BSPHUD window. BSPHUD creates this rule automatically. Since the window is unmanaged, the border is actually drawn by BSPHUD itself, not by bspwm. BSPHUD queries your preferred border width and color using bspc config.

  • If you plan to run multiple instances of BSPHUD (e.g. multiuser system), it is wise to change the location of the PID file. For example:

python -m bsphud --pidfile /var/run/user/$(id -u)/bsphud.pid
  • bug: If you send a SIGUSR signal to BSPHUD immediately after launching it, it might crash. Working on it!

  • BSPHUD is inspired by the venerable XFCE desktop envrionment, which has a comparable feature built-in.

Metadata

Release files for bsphud 1.0.5

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

Source distribution (sdist)

Source distribution for bsphud 1.0.5
File Size Uploaded Provenance Actions
bsphud-1.0.5.tar.gz 14.9 kB Without provenance Details for bsphud-1.0.5.tar.gz

Built distribution (wheel)

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

Total release size: 27.9 kB

Release files / bsphud-1.0.5.tar.gz

Download URL bsphud-1.0.5.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cf603bc832485b7a5c3d15bdb7fc572cd346a107710b0dcdbcf31cb9335b0e3a
BLAKE2b-256 checksum
How to use checksums
aec64e508e468b7889334edbe81a95b64fcb198703c25c45647c216e6179e26d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / bsphud-1.0.5-py3-none-any.whl

Download URL bsphud-1.0.5-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b7b13de9bc1e5bfee5db970e0491403fdb3328ecbeefe88d7f8b8849d534d96
BLAKE2b-256 checksum
How to use checksums
643691ea34954132b04795d4c7ebd264a69af35150a0c3e5197f7ec16aa07b34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for bsphud 1.0.5

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