Skip to main content

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.

PyWorkspace Manager UI

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

  1. Select an existing workspace name from the dropdown to replace it, or choose "Add New..." and type a new name.
  2. Click Save Workspace.
  3. 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

  1. Select a saved workspace from the dropdown.
  2. 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.
  3. Click Switch Workspace to only switch your view to that workspace's virtual desktop (without launching any programs).
  4. Click Refresh List to reload the workspace list.
  5. 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

  1. Scanning: Uses psutil and pywin32 to detect all visible windows on the current virtual desktop, capturing executable paths, command-line arguments, working directories, and open file handles.
  2. Virtual Desktop Detection: Uses Windows COM APIs and the pyvda library to identify which virtual desktop each window belongs to, and to move windows between desktops.
  3. Storage: Workspace data is persisted locally as JSON at ~/.pyworkspace_data.json.
  4. Restoration: Programs are re-launched via subprocess.Popen, files are opened with os.startfile, and windows are routed to the correct virtual desktop using pyvda.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyworkspace-1.0.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyworkspace-1.0.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

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

Hashes for pyworkspace-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3055a0d7f8d8c1646644e85619ee015e67118a89262352d4d3b2df0a419f50ac
MD5 2dca2f3f46fb74f23b88df1386fb324a
BLAKE2b-256 6cab263443ea24f3af237943094280e78ff0f6c5d7a18f18345ca5ea04a3a88c

See more details on using hashes here.

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

Hashes for pyworkspace-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8915ccb9129e8b5f199a0d77cb427f5bf58896cd4f841eb4e3490803ab77b3f
MD5 0d290f669a1ad9b76de85e9c5a511e7b
BLAKE2b-256 f10cfba9dc658b25f8ebe93e50b106ae3fa1137b83ced17df81622685b2dfad4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page