suntheme • Shipped 2026

Sun-powered terminal theming

Role

Developer & Designer

Timeline

Jan 2026

Team

Lucian Lavric

Skills

Rust

CLI Development

Daemon Architecture

Cross-Platform

Overview

Let the sun control your terminal theme

suntheme is a lightweight Rust daemon that automatically switches your terminal and editor themes based on the sun's position. No more manually toggling between light and dark mode—let nature decide. The tool uses your geolocation to calculate precise sunrise and sunset times, then seamlessly transitions your Ghostty terminal and Neovim themes at the perfect moment.

The Problem

Manual theme switching is tedious

Every developer knows the drill: squinting at a bright terminal in the evening, or struggling to read a dark theme in a sun-lit room. Most of us either pick one theme and stick with it, or manually toggle multiple times a day.

I wanted something that just worked—set it once and forget it. The theme should adapt to my environment automatically, following the natural rhythm of the day.

How It Works

Simple CLI, powerful daemon

The daemon runs as a background process that:

• Detects your location via OpenStreetMap's Nominatim API • Fetches sunrise/sunset times from the Sunrise-Sunset API (cached daily) • Calculates time until next switch and sleeps efficiently • Applies themes atomically to both Ghostty and Neovim • Supports 8 built-in theme presets (Tokyo Night, Gruvbox, Catppuccin, Nord, Dracula, Rose Pine, Kanagawa, Solarized)

Quick Start:

# Install via Homebrew (macOS) brew install suntheme # Interactive setup suntheme init # Start the daemon suntheme start # Check status suntheme status # Manual toggle suntheme toggle

Technical Implementation

Built with Rust for performance and reliability

The daemon is written in Rust (~1,500 lines) using a carefully curated set of dependencies:

clap for CLI argument parsing • reqwest with rustls-tls for secure HTTP requests • daemonize for background process management • libc for POSIX signal handling (SIGTERM, SIGUSR2) • chrono for timezone-aware datetime handling • dialoguer for interactive CLI prompts

Platform-Specific Integrations:

Ghostty (macOS): AppleScript automation for config reload • Ghostty (Linux): SIGUSR2 signal to all Ghostty processes • Neovim: File watcher using vim.uv.new_fs_event() API

The architecture prioritizes battery efficiency—the daemon calculates the exact time until the next theme switch and sleeps until then, with a maximum 1-hour wake interval for reliability.