suntheme-0.1.12 is not a library.
suntheme
Automatically switch Ghostty and Neovim themes based on sunrise/sunset times.
Installation
Homebrew (macOS)
Linux
|
Cargo (all platforms)
Note: After
cargo install, ensure~/.cargo/binis in your PATH:
Quick Start
# Initial setup - configures location and themes
# Start automatic theme switching daemon
Commands
| Command | Description |
|---|---|
suntheme init |
Interactive setup for location and themes |
suntheme start |
Start daemon for automatic switching |
suntheme stop |
Stop the daemon |
suntheme status |
Show daemon status and current theme |
suntheme toggle |
Toggle between light/dark |
suntheme set <light|dark> |
Set specific mode |
suntheme sun |
Display today's sunrise/sunset times |
suntheme themes |
Change theme configuration |
How it works
- Location-based sun times: Fetches sunrise/sunset times from sunrise-sunset.org API based on your location
- Daily caching: Sun times are cached daily to minimize API calls
- Ghostty: Modifies your Ghostty config file and triggers a reload
- Neovim: Writes to a state file that Neovim watches for changes
Requirements
- macOS: Accessibility permissions required for Ghostty auto-reload (prompted during setup)
- Linux: Auto-reload works via SIGUSR2 signal (no extra dependencies)
- Neovim 0.9+: For file watching support
- Ghostty: Any recent version
Configuration
Config is stored at:
- macOS:
~/Library/Application Support/suntheme/config.toml - Linux:
~/.config/suntheme/config.toml
[]
= 43.6532
= -79.3832
[]
= "tokyonight-day"
= "tokyonight"
[]
= "tokyonight-day"
= "tokyonight"
Roadmap
- Windows support
- Linux support
- iTerm2 support
- VS Code support
- System theme support
- Gradient transition between light and dark themes to mimic sunrise/sunset
License
MIT