PyWorkspace
A Windows virtual desktop workspace manager built with Python and PyQt6. Save snapshots of your running programs, open files, and virtual desktop layout — then restore everything exactly as it was with a single click.
Features
- Save Workspaces — Automatically detects all visible programs on your current Windows virtual desktop (executables, arguments, working directories, open files) and saves a complete snapshot.
- Resume Workspaces — Restores all saved programs, files, and routes them to the correct virtual desktop.
- Switch Workspace — Instantly switch your active Windows virtual desktop to a saved workspace's desktop.
- Multiple Workspaces — Manage as many named workspaces as you need (e.g. "Coding", "Research", "Design").
- Local JSON Storage — All workspace data is saved locally to
~/.pyworkspace_data.json. No cloud account or API keys needed. - Delete Workspaces — Remove workspaces you no longer need.
Requirements
- Windows 10/11 (virtual desktop features require Windows)
- Python 3.10+
Installation
pip install pyworkspace
Usage
Launching the GUI
After installation, simply run:
pyworkspace
This opens the PyWorkspace Manager window with two sections:
1. Save/Replace Current Desktop
- Select an existing workspace name from the dropdown to replace it, or choose "Add New..." and type a new name.
- Click Save Workspace.
- PyWorkspace will scan all visible programs on your current virtual desktop and save a full snapshot (program paths, arguments, working directories, window titles, and open files).
2. Resume Workspace
- Select a saved workspace from the dropdown.
- Click Resume Selected to restore the workspace:
- Switches to the workspace's original virtual desktop.
- Clears any existing programs on that desktop.
- Re-launches all saved programs with their original arguments and working directories.
- Re-opens all previously open files.
- Click Switch Workspace to only switch your view to that workspace's virtual desktop (without launching any programs).
- Click Refresh List to reload the workspace list.
- Click Delete to permanently remove a workspace.
Programmatic Usage
You can also use PyWorkspace as a Python library:
from pyworkspace import Workspace, Session
# Create a workspace
ws = Workspace("Development")
ws.add_program(r"C:\Program Files\MyEditor\editor.exe", args="--project myapp")
ws.add_file(r"C:\Projects\myapp\README.md")
# Save and manage via session
session = Session("dev_session.json")
session.add_workspace(ws)
session.save()
# Later, resume everything
session.resume()
How It Works
- Scanning: Uses
psutilandpywin32to detect all visible windows on the current virtual desktop, capturing executable paths, command-line arguments, working directories, and open file handles. - Virtual Desktop Detection: Uses Windows COM APIs and the
pyvdalibrary to identify which virtual desktop each window belongs to, and to move windows between desktops. - Storage: Workspace data is persisted locally as JSON at
~/.pyworkspace_data.json. - Restoration: Programs are re-launched via
subprocess.Popen, files are opened withos.startfile, and windows are routed to the correct virtual desktop usingpyvda.
Dependencies
Installed automatically via pip:
| Package | Purpose |
|---|---|
PyQt6 |
GUI framework |
psutil |
Process and window detection |
pywin32 |
Windows API access |
comtypes |
COM interface for virtual desktops |
pyvda |
Virtual desktop switching and window movement |
License
MIT
Release files for pyworkspace 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyworkspace-1.0.1.tar.gz | 18.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyworkspace-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.0 kB
Release files / pyworkspace-1.0.1.tar.gz
| Download URL | pyworkspace-1.0.1.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3055a0d7f8d8c1646644e85619ee015e67118a89262352d4d3b2df0a419f50ac
|
|
BLAKE2b-256 checksum How to use checksums |
6cab263443ea24f3af237943094280e78ff0f6c5d7a18f18345ca5ea04a3a88c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Release files / pyworkspace-1.0.1-py3-none-any.whl
| Download URL | pyworkspace-1.0.1-py3-none-any.whl |
|---|---|
| Size | 20.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8915ccb9129e8b5f199a0d77cb427f5bf58896cd4f841eb4e3490803ab77b3f
|
|
BLAKE2b-256 checksum How to use checksums |
f10cfba9dc658b25f8ebe93e50b106ae3fa1137b83ced17df81622685b2dfad4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|