Skip to main content

System tray application for OpenAdapt

Project description

openadapt-tray

License: MIT Python 3.10+

A cross-platform system tray application for OpenAdapt, providing a graphical interface for controlling recording, monitoring training, and accessing settings without using the command line.

Features

System Tray Icon

Shows in the menu bar (macOS) or system tray (Windows/Linux) with visual state indicators.

Tray Icon Idle Idle state: Blue/gray icon in menu bar

Tray Icon Recording Recording state: Red pulsing icon

Native Notifications

Modern notifications with desktop-notifier supporting callbacks and actions.

Basic Notification Example: Recording started notification

Critical Notification Example: Error notification with critical urgency

Other Features

  • Status Indicators: Icon changes color based on application state (idle, recording, training, error)
  • Start/Stop Recording: Control capture sessions via menu or global hotkeys
  • Recent Captures: Quick access to view or delete recent recordings
  • Training Control: Start, monitor, and stop model training
  • Cross-Platform: Works on macOS, Windows, and Linux
  • Lightweight: Uses pystray (~50KB) instead of heavy Qt dependencies

Installation

pip install openadapt-tray

For macOS native experience with enhanced menu bar features:

pip install openadapt-tray[macos-native]

Quick Start

# Run the tray application
openadapt-tray

# Or run as a Python module
python -m openadapt_tray

Keyboard Shortcuts

Action Default Shortcut
Toggle Recording Ctrl+Shift+R
Open Dashboard Ctrl+Shift+D
Stop Recording Ctrl (triple tap)

Shortcuts are configurable via the settings file or dashboard.

Menu Structure

Menu Structure Full menu in idle state

[OpenAdapt Icon]
├── Start Recording (Ctrl+Shift+R)
│   └── [When recording: "Stop Recording (capture-name)"]
├── ─────────────
├── Recent Captures
│   ├── capture-name (2024-01-15 14:30)
│   │   ├── View
│   │   └── Delete
│   └── View All...
├── Training
│   ├── Start Training...
│   └── View Last Results
├── ─────────────
├── Open Dashboard
├── Settings...
├── ─────────────
└── Quit

Configuration

Configuration is stored in:

  • macOS: ~/Library/Application Support/openadapt/tray.json
  • Windows: %APPDATA%/openadapt/tray.json
  • Linux: ~/.config/openadapt/tray.json

Example configuration:

{
  "hotkeys": {
    "toggle_recording": "<ctrl>+<shift>+r",
    "open_dashboard": "<ctrl>+<shift>+d",
    "stop_recording": "<ctrl>+<ctrl>+<ctrl>"
  },
  "dashboard_port": 8080,
  "show_notifications": true,
  "stop_on_triple_ctrl": true,
  "auto_start_on_login": false
}

Development

Setup

# Clone the repository
git clone https://github.com/OpenAdaptAI/openadapt-tray.git
cd openadapt-tray

# Install in development mode
pip install -e ".[dev]"

Running Tests

pytest tests/

Project Structure

openadapt-tray/
├── src/openadapt_tray/
│   ├── __init__.py           # Package exports
│   ├── __main__.py           # Entry point
│   ├── app.py                # Main TrayApplication class
│   ├── menu.py               # Menu construction
│   ├── icons.py              # Icon management
│   ├── notifications.py      # Cross-platform notifications
│   ├── shortcuts.py          # Global hotkey handling
│   ├── config.py             # Configuration management
│   ├── ipc.py                # Inter-process communication
│   ├── state.py              # Application state machine
│   └── platform/
│       ├── __init__.py       # Platform detection
│       ├── base.py           # Abstract base class
│       ├── macos.py          # macOS-specific
│       ├── windows.py        # Windows-specific
│       └── linux.py          # Linux-specific
├── assets/
│   ├── icons/                # State icons (idle, recording, etc.)
│   └── logo.ico              # Windows icon
├── tests/                    # Test suite
├── pyproject.toml
└── README.md

Dependencies

  • pystray (>=0.19.0): Cross-platform system tray
  • Pillow (>=9.0.0): Icon handling
  • pynput (>=1.7.0): Global hotkeys
  • click (>=8.0.0): CLI integration
  • desktop-notifier (>=6.2.0): Modern native notifications

Integration

The tray application delegates to the openadapt CLI for all operations:

# Commands executed by the tray app
openadapt record <name>          # Start recording
openadapt visualize <path>       # View capture
openadapt train start            # Start training
openadapt train status           # Get training status

Platform Notes

macOS

  • Hides from the Dock, appears only in the menu bar
  • Native dialogs via AppleScript
  • Auto-start via Launch Agents

Windows

  • Appears in the system tray
  • Native dialogs via ctypes/tkinter
  • Auto-start via Registry

Linux

  • Requires a desktop environment with system tray support
  • Dialogs via zenity, kdialog, or tkinter
  • Auto-start via XDG autostart

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please see our contributing guidelines.

Links

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

openadapt_tray-0.0.1.tar.gz (95.2 kB view details)

Uploaded Source

Built Distribution

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

openadapt_tray-0.0.1-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file openadapt_tray-0.0.1.tar.gz.

File metadata

  • Download URL: openadapt_tray-0.0.1.tar.gz
  • Upload date:
  • Size: 95.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openadapt_tray-0.0.1.tar.gz
Algorithm Hash digest
SHA256 7ced5b6db2752044c63c0822860cc6dcd72749963a0a3d1c19627e97589e68f2
MD5 b92fabb6569b5ebdd483c7e1a7177c7f
BLAKE2b-256 909894603d08d9bf9bce99ee505cf535d2f07d3ffa457eeeb9aa79fa88310204

See more details on using hashes here.

Provenance

The following attestation bundles were made for openadapt_tray-0.0.1.tar.gz:

Publisher: release.yml on OpenAdaptAI/openadapt-tray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openadapt_tray-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: openadapt_tray-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openadapt_tray-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 05563968561f1b5d6726f958597cc9feaec1daec17ca4a7ed8cf6b631a6f4371
MD5 77fd509ccf5a61e89bc729176077172e
BLAKE2b-256 f80ba5ab517d03a3f21026bf1b6ee513293a73e8c81e3c5269c2224f2163de42

See more details on using hashes here.

Provenance

The following attestation bundles were made for openadapt_tray-0.0.1-py3-none-any.whl:

Publisher: release.yml on OpenAdaptAI/openadapt-tray

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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