github psi4j/sunsetr v0.5.0
v0.5.0 Geolocation-based Transitions!

latest releases: v0.11.1, v0.11.0, v0.10.0...
5 months ago

Sunsetr v0.5.0 Release Notes

🌍 Geographic Location-Based Transitions

The headline feature of v0.5.0 is comprehensive geographic location support, bringing natural, location-aware color temperature transitions that automatically adjust throughout the year.

Interactive City Selection

Run sunsetr --geo to launch an interactive fuzzy search interface featuring:

  • 10,000+ cities worldwide with precise coordinates
  • Smart search by city name, country, or region
  • Automatic timezone detection for accurate local sunset/sunrise times

Automatic Location Detection

When you first run sunsetr without selecting a city, it intelligently detects your approximate location using:

  • System timezone analysis with multiple fallback methods
  • 466 timezone-to-coordinate mappings covering the entire globe

Enhanced Solar Calculations

The new geographic mode (transition_mode = "geo") provides:

  • Precise solar calculations using +10° to -2° sun elevation angles
  • Bézier curve transitions for more natural color temperature changes
  • Extreme latitude support with special handling for polar regions
  • Year-round accuracy with automatic seasonal adjustments

Debug Solar Information

Run sunsetr --debug to see detailed calculations for your location:

[LOG] Solar calculation details:
┃           Raw coordinates: 29.4241°, -98.4936°
┃               Sunrise UTC: 11:35
┃                Sunset UTC: 01:37
┃       Coordinate Timezone: America/Chicago (-05:00)
┃   --- Sunset (descending) ---
┃   Transition start (+10°): 19:51:57
┃   Golden hour start (+6°): 20:10:07
┃               Sunset (0°): 20:37:21
┃      Transition end (-2°): 20:46:25
┃          Civil dusk (-6°): 21:04:35
┃            Night duration: 9 hours 40 minutes
┃   --- Sunrise (ascending) ---
┃          Civil dawn (-6°): 06:08:37
┃    Transition start (-2°): 06:26:46
┃              Sunrise (0°): 06:35:51
┃     Golden hour end (+6°): 07:03:05
┃     Transition end (+10°): 07:21:14
┃              Day duration: 12 hours 30 minutes
┃           Sunset duration: 54 minutes
┃          Sunrise duration: 54 minutes
┃
[LOG] Next transition will begin at: 06:26:45 Night   → Sunrise 󰖜

🔄 Live Configuration Reload

New --reload command allows instant configuration updates without restarting:

sunsetr --reload
  • Preserves current transition state
  • Applies new settings immediately
  • Works with running instances via signal handling

🧪 Interactive Temperature Testing

Test different color temperatures and gamma values with the new --test command:

sunsetr --test 3300 90  # Warm night time values
# Press ESC or Ctrl+C to restore previous settings

Signal-Based Architecture Improvements

Enhanced Process Communication

  • SIGUSR2: Configuration reload signal
  • SIGUSR1: Test mode activation
  • Zero-polling event-driven redesign for CPU efficiency

Robust Lock File Mechanism

  • Automatic stale lock detection and cleanup
  • Cross-compositor awareness

Additional Improvements

Performance Optimizations

  • Event-driven main loop eliminates unnecessary CPU wake-ups
  • Intelligent state tracking prevents redundant backend updates
  • Parallel operations for configuration reload and gamma reset

Enhanced Error Handling

  • Clearer error messages with actionable guidance
  • Graceful fallback for location detection failures
  • Improved signal handler stability with comprehensive lifecycle tracking

Process Management

  • PR_SET_PDEATHSIG ensures hyprsunset cleanup on parent death
  • Process group isolation for proper signal handling
  • Compositor-native spawning for correct parent-child relationships

Configuration Changes

New installations now default to geographic mode:

transition_mode = "geo"  # Automatic sunrise/sunset based on location
latitude = 40.7128       # Auto-detected or set via --geo
longitude = -74.0060     # Use sunsetr --geo to update

Bug Fixes

  • Fixed gamma persistence when switching between compositors (use sunetr --reload if needed)
  • Resolved signal handling race conditions
  • Corrected lock file truncation issue
  • Fixed hyprsunset cleanup on forceful termination
  • Improved parent death monitoring reliability

Documentation

  • Comprehensive rustdoc comments throughout codebase
  • Detailed implementation notes in IMPLEMENTATION_CHANGES.md
  • Updated README with geo mode instructions
  • Added extensive test coverage for lock mechanisms

Full Changelog: v0.4.0...v0.5.0

Installation:

  • Build from source: cargo build --release
  • AUR: paru -S sunsetr-bin

Upgrade Notes:

  • Existing configurations remain compatible
  • Run sunsetr --geo to enable location-based transitions
  • New --reload and --test commands available immediately

Don't miss a new sunsetr release

NewReleases is sending notifications on new releases.