Skip to main content

Cross-platform autostart installer library for Python

Project description

🚀 onboot

PyPI version Python Support License: MIT Code style: black

Cross-platform autostart installer library for Python

onboot provides a unified interface to install and manage autostart entries across different operating systems and initialization methods. Whether you need to configure startup scripts on Linux, launch agents on macOS, or registry entries on Windows, onboot has you covered.


✨ Features

🐧 Linux

  • XDG - XDG Autostart standard
  • Cron - Cron jobs (@reboot)
  • Profile.d - Shell profile scripts
  • KDE Plasma - KDE autostart
  • Init.d - System V init scripts

🍎 macOS (Darwin)

  • PList - Launch Agents/Daemons
  • Cron - Cron jobs (@reboot)

🪟 Windows

  • StartMenu - Startup folder
  • Registry - Windows Registry
    • ✅ HKCU (Current User)
    • ✅ HKLM (Local Machine)
    • ⏳ IFEO (Image File Execution Options)
    • ⏳ UserInit (Winlogon)
  • Task Scheduler - Windows Task Scheduler
  • WMIC - Windows Management Instrumentation

📦 Installation

Install onboot using pip:

pip install onboot

Or with uv:

uv add onboot

🔧 Usage

Quick Start - Auto-detect Best Installer

Let onboot automatically try all available installers for your operating system:

from onboot import install_linux, InstallerConfiguration

# Create configuration
config = InstallerConfiguration("/home/user/myapp", "myapp")

# Install - tries all available installers until one succeeds
install_successful, used_installer = install_linux(config)

# Uninstall using the same installer
if install_successful:
    used_installer.uninstall()

Platform-Specific Functions

from onboot import install_windows, install_darwin, InstallerConfiguration

# Windows
success, installer = install_windows(InstallerConfiguration("C:\\myapp", "myapp"))

# macOS
success, installer = install_darwin(InstallerConfiguration("/Users/user/myapp", "myapp"))

Use a Specific Installer

For more control, use a specific installer directly:

from onboot.windows import HKCUInstaller
from onboot import InstallerConfiguration

# Create configuration
config = InstallerConfiguration("C:\\myapp", "myapp")

# Use Windows Registry (HKCU) installer
installer = HKCUInstaller(config)
installer.install()

# Later, uninstall
installer.uninstall()

Available Installers by Platform

Linux:

from onboot.linux import (
    XDGInstaller,              # XDG autostart (.desktop files)
    CrontabInstaller,          # Crontab @reboot
    ProfileInstaller,          # /etc/profile.d/
    KDEPlasmaInstaller,        # KDE Plasma autostart scripts
    InitInstaller,             # /etc/init.d/
    SystemdUserInstaller,      # ~/.config/systemd/user/ services
    SystemdSystemInstaller,    # /etc/systemd/system/ services
    BashrcInstaller,           # ~/.bashrc
    RcLocalInstaller           # /etc/rc.local
)

macOS:

from onboot.darwin import (
    PListInstaller,            # ~/Library/LaunchAgents/
    LaunchDaemonInstaller,     # /Library/LaunchDaemons/ (system-wide)
    ProfileInstaller           # /etc/profile
)

Windows:

from onboot.windows import (
    HKCUInstaller,             # HKEY_CURRENT_USER registry
    HKLMInstaller,             # HKEY_LOCAL_MACHINE registry
    StartMenuInstaller,        # Start Menu startup folder
    SchTaskInstaller,          # Task Scheduler
    UserInitInstaller          # Winlogon UserInit
)

📝 Configuration

The InstallerConfiguration class accepts the following parameters:

  • directory (Path): Directory containing the executable or script
  • name (str): Name of the application/service (filename)

Example:

from pathlib import Path
from onboot import InstallerConfiguration

config = InstallerConfiguration(
    directory=Path("/usr/local/bin"),
    name="myapp"
)

# The full path will be: /usr/local/bin/myapp
print(config.get_path())

🛠️ Development

This project uses uv for dependency management.

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install dependencies
uv sync

# Run tests
uv run pytest

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

onboot-1.0.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

onboot-1.0.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file onboot-1.0.2.tar.gz.

File metadata

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

File hashes

Hashes for onboot-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3a77adc016b368bef3f066ed47bf8f88d95eafae5f9bb34818e38dd2b69f11c4
MD5 09fe6d674f5ca5900fedfada724004ee
BLAKE2b-256 1431d8f7d7b25b739078974738a9d0216bcdf845b88c1d007f34b19a533d098a

See more details on using hashes here.

Provenance

The following attestation bundles were made for onboot-1.0.2.tar.gz:

Publisher: publish.yml on nbdy/onboot

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

File details

Details for the file onboot-1.0.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for onboot-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5fae95d6330872fb0ed7a707ebc38816af58a5043f9791a4df5f016ba34ee5e5
MD5 702f678cd79d9358f57dbb624d1a8c9f
BLAKE2b-256 c59bb5288dc88e4c96895c22f552eba9fddda47d69fcb474bd4e91d692764a95

See more details on using hashes here.

Provenance

The following attestation bundles were made for onboot-1.0.2-py3-none-any.whl:

Publisher: publish.yml on nbdy/onboot

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