A Python-based Windows Virtual Desktop workspace manager.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyworkspace-1.0.1.tar.gz.
File metadata
- Download URL: pyworkspace-1.0.1.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3055a0d7f8d8c1646644e85619ee015e67118a89262352d4d3b2df0a419f50ac
|
|
| MD5 |
2dca2f3f46fb74f23b88df1386fb324a
|
|
| BLAKE2b-256 |
6cab263443ea24f3af237943094280e78ff0f6c5d7a18f18345ca5ea04a3a88c
|
File details
Details for the file pyworkspace-1.0.1-py3-none-any.whl.
File metadata
- Download URL: pyworkspace-1.0.1-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8915ccb9129e8b5f199a0d77cb427f5bf58896cd4f841eb4e3490803ab77b3f
|
|
| MD5 |
0d290f669a1ad9b76de85e9c5a511e7b
|
|
| BLAKE2b-256 |
f10cfba9dc658b25f8ebe93e50b106ae3fa1137b83ced17df81622685b2dfad4
|