pi-auto-theme-switcher

Automatically switch pi themes based on macOS system appearance (dark/light mode)

Packages

Package details

extension

Install pi-auto-theme-switcher from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-auto-theme-switcher
Package
pi-auto-theme-switcher
Version
1.1.4
Published
Jun 26, 2026
Downloads
469/mo · 24/wk
Author
iodic
License
MIT
Types
extension
Size
165.1 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "extensions"
  ],
  "image": "https://raw.githubusercontent.com/iodic/pi-auto-theme-switcher/main/previews/preview.png"
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-auto-theme-switcher

Automatically switch pi themes based on macOS system appearance.

Polls system dark/light mode every 3 seconds and applies the matching theme. Works with any installed pi themes.

pi-auto-theme-switcher

Install

pi install npm:pi-auto-theme-switcher

Or add to ~/.pi/agent/settings.json:

{
  "packages": ["npm:pi-auto-theme-switcher"]
}

Usage

On first run, auto-theme maps to pi's built-in dark and light themes. Use /auto-theme config to pick your preferred themes:

/auto-theme config

This opens a picker for both dark and light mode themes from all installed themes.

Commands

Command Description
/auto-theme Show current config and status
/auto-theme config Pick which themes map to dark & light mode
/auto-theme on Enable auto-switching
/auto-theme off Disable auto-switching

Example with ayu themes

{
  "packages": [
    "git:github.com/iodic/pi-ayu-themes",
    "npm:pi-auto-theme-switcher"
  ]
}

Then run /auto-theme config and select ayu-dark for dark mode and ayu-light for light mode.

Config

Saved to ~/.pi/agent/auto-theme.json:

{
  "dark": "ayu-dark",
  "light": "ayu-light",
  "enabled": true
}

Platform

macOS only. Uses osascript to query system appearance. No-op on other platforms.

License

MIT