Skip to content

Releases: psi4j/sunsetr

v0.11.1

06 Nov 18:34

Choose a tag to compare

This update fixes an issue where the gamma table sizes for multiple monitors could be different when using the Wayland backend, causing niri (and potentially other compositors) to reject the gamma control/updates for some of the monitors, if not all of them.

This update also adds a new target_period field to the IPC for better control over the timing of the Period update when switching presets. This gives immediate feedback for the new Period where otherwise you would have to wait for the period_changed event after the smooth transition completes when smoothing is enabled. You can use the IPC directly or via proxy through the status command (sunsetr status --json --follow).

Usage e.g.:

// ~/.config/waybar/config
{
  "custom/sunsetr": {
    "exec": "sunsetr status --json --follow | jq --unbuffered --compact-output 'if .event_type == \"preset_changed\" then {text: \"\\(.target_temp)K\", alt: .target_period, tooltip: \"Preset: \\(.to_preset // \"default\")\\nTarget: \\(.target_temp)K @ \\(.target_gamma)%\"} elif .event_type == \"state_applied\" then {text: \"\\(.current_temp)K\", alt: .period, tooltip: \"Period: \\(.period)\\nTemp: \\(.current_temp)K @ \\(.current_gamma)%\"} else empty end'",
    "return-type": "json",
    "format": "{icon} {text}",
    "format-icons": {
      "day": "󰖨",
      "night": "",
      "sunset": "󰖛",
      "sunrise": "󰖜",
      "static": "󰋙"
    },
    "on-click": "sunsetr preset day"
  }
}

v0.11.0 IPC and Status Command!

06 Nov 02:17

Choose a tag to compare

Sunsetr v0.11.0

This release brings significant improvements to Sunsetr's command-line interface, state monitoring capabilities, and reliability. v0.11.0 focuses on giving users better control over the application lifecycle and fixing critical timing issues that affected transitions.

New Commands

status command

The status command returns data using the new IPC. Running without flags returns a one-shot output containing runtime state details. Using the --follow flag returns a continuous human-readable stream, and using the --json flag returns output in JSON for scripting and interoperation.

Usage:

sunsetr status          # Human-readable output
sunsetr status --json   # JSON output for scripting
sunsetr status --follow # Continuous monitoring
sunsetr status -j -f    # Continuous JSON monitoring

Example output:

❯ sunsetr status
 Active preset: default
Current period: Night 
         State: stable
   Temperature: 3300K
         Gamma: 90.0%
   Next period: 06:42:50 (in 11h47m)

Related: #11 #24


stop command

Gracefully terminate a running Sunsetr instance with verification.

Usage:

sunsetr stop

restart command

Recreate the backend and reload configuration with a clean stop-wait-start sequence.

Usage:

sunsetr restart              # Normal restart with smooth shutdown
sunsetr restart --instant    # Skip smooth shutdown transition
sunsetr restart --background # Restart in background mode
  • Clean stop-wait-start sequence (replaces complex in-process backend recreation)
  • --instant flag to skip smooth shutdown transitions
  • Useful for recovering from DPMS issues or compositor switches
  • Compatible with --background flag

Replaces: The deprecated reload command (see Breaking Changes)

Related: #25


--background flag

Run Sunsetr as a background process without occupying your terminal.

Usage:

sunsetr --background          # Start in background
sunsetr restart --background  # Restart in background

IPC for sharing internal state

sunsetr now provides a Unix socket-based IPC for real-time integration with external applications like status bars (waybar, quickshell, eww), notification systems, and custom scripts. The IPC socket is automatically created when sunsetr starts:

$XDG_RUNTIME_DIR/sunsetr/ipc.sock
# Typically: /run/user/1000/sunsetr/ipc.sock

The IPC system broadcasts three types of events in JSON format:

  1. StateApplied: Emitted whenever the display state changes (every update interval, config reloads, preset changes)
{
  "event_type": "state_applied",
  "active_preset": "default",
  "period": "sunset",
  "state": "transitioning",
  "progress": 0.45,
  "current_temp": 5100,
  "current_gamma": 95.0,
  "target_temp": 3300,
  "target_gamma": 90.0,
  "next_period": "2025-01-15T19:00:00-06:00"
}

Fields:

  • event_type: Always "state_applied"
  • active_preset: Name of the currently active preset (or "default")
  • period: Current period - "day", "night", "sunset", "sunrise", or "static"
  • state: Period type for categorization - "stable", "transitioning", or "static"
  • progress: Transition progress (0.0 to 1.0), only present during transitions
  • current_temp: Currently applied temperature in Kelvin
  • current_gamma: Currently applied gamma as percentage
  • target_temp: Target temperature (only present during transitions)
  • target_gamma: Target gamma (only present during transitions)
  • next_period: ISO 8601 timestamp of next scheduled period (null for static mode)
  1. PeriodChanged: Emitted only during automatic time-based period transitions
{
  "event_type": "period_changed",
  "from_period": "day",
  "to_period": "sunset"
}

Fields:

  • event_type: Always "period_changed"
  • from_period: The period we're transitioning from
  • to_period: The period we're transitioning to
  1. PresetChanged: Emitted when switching presets
{
  "event_type": "preset_changed",
  "from_preset": null,
  "to_preset": "gaming",
  "target_period": "static",
  "target_temp": 4700,
  "target_gamma": 100.0
}

Fields:

  • event_type: Always "preset_changed"
  • from_preset: Previous preset name (null if transitioning from default config)
  • to_preset: New preset name (null if transitioning to default config) (New only on latest git)
  • target_period: Target period after preset change - "day", "night", "sunset", "sunrise", or "static"
  • target_temp: Target temperature in Kelvin
  • target_gamma: Target gamma as percentage

e.g.:

Recommended: Real-time updates with dynamic icons
(This particular example only works on latest git as of right now due to the added target_period field)

// ~/.config/waybar/config
{
  "custom/sunsetr": {
    "exec": "sunsetr status --json --follow | jq --unbuffered --compact-output 'if .event_type == \"preset_changed\" then {text: \"\\(.target_temp)K\", alt: .target_period, tooltip: \"Preset: \\(.to_preset // \"default\")\\nTarget: \\(.target_temp)K @ \\(.target_gamma)%\"} elif .event_type == \"state_applied\" then {text: \"\\(.current_temp)K\", alt: .period, tooltip: \"Period: \\(.period)\\nTemp: \\(.current_temp)K @ \\(.current_gamma)%\"} else empty end'",
    "return-type": "json",
    "format": "{icon} {text}",
    "format-icons": {
      "day": "󰖨",
      "night": "",
      "sunset": "󰖛",
      "sunrise": "󰖜",
      "static": "󰋙"
    },
    "on-click": "sunsetr preset day"
  }
}

related: #11 #24


Bug Fixes

  • Period transitions now happen precisely on time instead of one update_interval after start time
  • Time jumps (manual adjustments, NTP sync, sleep/resume) now immediately apply correct temperature/gamma values
  • DST changes are now correctly accounted for in status output and transition schedules
  • Zombie processes from previous sessions are automatically detected and cleaned up after logout/reboot
  • Test mode now properly prevents concurrent regular instances from starting
  • Preset switching no longer incorrectly reverts to default configuration or skips period announcements
  • Command flags (--config on set and get commands) now work correctly with flexible placement

Breaking Changes

The reload command has been deprecated and removed in favor of:

  1. Automatic hot configuration reloading - Config changes are automatically detected
  2. restart command - For full re-initialization when needed

Migration:

# Old way:
sunsetr reload

# New way:
sunsetr restart --background  # Or just edit config - it auto-reloads!

With automatic hot configuration reloading, the reload command became redundant. The restart command provides a more robust solution for cases requiring full re-initialization. Fully removed in this release. Using sunsetr reload will show a deprecation warning and map to restart --background.


Other Improvements

  • Extended gamma range Gamma range extended from 100% to 200%, matching Hyprsunset's capabilities.) (#26)
  • Architectural improvements: Cleaner state management with immutable patterns and centralized context
  • Code quality: Improved documentation, error messages, and terminal signal handling
  • Testing: Extended gamma range tests and property-based configuration validation
  • Data accuracy: Fixed country/coordinate data and added Asia/Kolkata timezone

New AUR Packages


Upgrade Notes

  1. Config compatibility: All existing configurations remain compatible
  2. Gamma range: You can now use values up to 200% if desired
  3. Command changes: Replace any reload commands with restart or rely on automatic hot reloading
  4. New commands: Try out status, stop, and restart for better process management

💛 Special thanks to:


Full Changelog

See the commit history for complete details.

v0.10.0 New Hyprland CTM Backend!

28 Sep 23:33

Choose a tag to compare

Sunsetr v0.10.0

This release brings useful configuration management capabilities with new CLI commands, native Hyprland CTM backend support, and significant improvements to user experience through enhanced help systems and error handling. The codebase has undergone substantial backend refactoring to improve maintainability and prepare for future enhancements.

New Features

Configuration Management Commands

  • New get command for reading configuration values programmatically
  • Supports JSON output format for scripting and automation
  • Can target specific configurations (default or named presets)
  • Retrieve single fields, multiple fields, or entire configuration

Usage: Read configuration values from the command line:

# Get specific fields
sunsetr get night_temp          # Returns: night_temp = 3300
sunsetr get night_temp day_temp # Multiple fields at once

# Get entire configuration
sunsetr get all

# JSON output for scripting
sunsetr get --json night_temp   # Returns: {"night_temp": 3300}
sunsetr get --json all

# Target specific configurations
sunsetr get --target default night_temp  # From base config
sunsetr get -t gaming static_temp        # From gaming preset

Configuration Modification Command

  • New set command for modifying configuration fields from CLI
  • Validates all values before saving
  • Shows warnings for potentially problematic changes
  • Preserves configuration structure and comments
  • Supports targeting specific configurations (default or presets)

Usage: Modify configuration values safely:

# Set configuration values
sunsetr set night_temp=3500               # Update night temperature
sunsetr set night_temp=3500 day_temp=6000 # Multiple values at once

# Target specific configurations
sunsetr set --target default night_temp=3500 # Modify base config
sunsetr set -t gaming static_temp=4700       # Modify gaming preset

The set command includes interactive warnings when editing preset configurations to prevent accidental changes.

Enhanced Preset System

  • New subcommands for the preset command
  • preset active shows the currently active preset
  • preset list displays all available presets
  • Improved preset switching logic and error handling

Usage:

# Show currently active preset
sunsetr preset active   # or 'sunsetr p active'

# List all available presets
sunsetr preset list     # or 'sunsetr p list'

Native Hyprland CTM Backend

  • New native Color Transformation Matrix backend for Hyprland
  • Eliminates dependency on hyprsunset for compatible Hyprland versions
  • Direct protocol communication using hyprland-ctm-control-v1
  • Maintains backward compatibility with hyprsunset backend option

Configuration: The backend system now supports four options:

backend = "auto"        # Auto-detect (recommended)
backend = "hyprland"    # Native CTM backend
backend = "hyprsunset"  # Use hyprsunset as dependency
backend = "wayland"     # Universal Wayland backend

Notes:

  • The start_hyprsunset field is deprecated and no longer has any effect if used. To use hyprsunset as a backend, use backend = "hyprsunset". Starting hyprsunset separately is no longer supported as of v0.10.0. I have no idea why you would do this anyways.
  • Use the Wayland backend to use sunsetr's smooth transitions enabled with smoothing = true.
  • The native Hyprland backend and Hyprsunset backend use Hyprland's built-in CTM animations instead. To disable these animations, add to hyprland.conf:
render {
    ctm_animation = 0
}

Comprehensive Help System

  • New help command provides detailed documentation for all commands
  • Command-specific help pages with usage examples
  • Short aliases supported (e.g., sunsetr h p for preset help)
  • Improved --help output with better organization

Usage:

# General help
sunsetr help            # Show all available commands
sunsetr --help          # Show detailed usage information

# Command-specific help
sunsetr help preset     # Detailed help for preset command
sunsetr help set        # Detailed help for set command
sunsetr help get        # Detailed help for get command

XDG Base Directory Support

  • State management now follows XDG Base Directory specification
  • Display state tracking moved to $XDG_RUNTIME_DIR/sunsetr/
  • Better organization of runtime files and state
  • Improved privacy for path displays in logs

Technical Improvements

Backend Architecture Refactoring

  • Split Hyprland backend into separate hyprsunset and native CTM implementations
  • Moved gamma calculation logic to shared module
  • Improved backend trait design for better extensibility
  • Enhanced debug output for all backends
  • Better error handling and recovery mechanisms

Enhanced Error Handling

  • Standardized error severity levels across all commands
  • Colored severity indicators in terminal output
  • Cleaner multi-line error formatting
  • Better user guidance with actionable error messages
  • Privacy-preserving path displays in error output

Logger Improvements

  • Simplified logger format for cleaner aesthetic
  • Colored severity levels (red for errors, yellow for warnings)
  • Improved spacing and indentation
  • Better handling of multi-line output
  • Consistent formatting across all commands

Bug Fixes

  • Fixed config directory handling when using --config flag with commands
  • Corrected privacy path display in watcher module
  • Improved error propagation in CLI argument parsing
  • Resolved issues with preset state tracking across commands

v0.9.0 Presets and Hot Reloading

12 Sep 03:03

Choose a tag to compare

Sunsetr v0.9.0

This release brings major improvements to user experience with preset management, smooth transitions, hot configuration reloading, and a new static mode. The codebase has undergone significant refactoring to improve maintainability and reliability.

New Features

Static Mode

  • New static transition mode that maintains constant temperature and gamma values
  • Perfect for when you need consistent values without time-based transitions
  • Night and day configuration fields are ignored when using static mode
  • Time related configuration fields are also ignored when using static mode
  • Fully integrated with the preset system for quick static value switching

Usage: Configure in your sunsetr.toml:

# Static mode - constant values, no transitions
transition_mode = "static"
static_temp = 5000       # Constant color temperature (1000-20000) Kelvin
static_gamma = 90        # Constant gamma percentage (10-100%)

# Note: sunset/sunrise/day/night values not needed for static mode

Combine with presets for quick static toggles

Preset Management System

  • New preset command allows quick switching between different configuration presets stored in a directory hierarchy
  • Seamlessly toggle between different profiles (e.g., default, gaming, weekend, day)
  • Use sunsetr preset default to return to your main configuration
  • Or call same preset twice to return to default as well
  • Resolves issue #16 by enabling easy toggling of static temperature/gamma values

Usage:

# Switch to a specific preset
sunsetr preset day # sets static day temp/gamma

# Return to default configuration
sunsetr preset day

You can also set a keybind for toggling:

# Hyprland hyprland.conf
bind = $mod, W, exec, sunsetr p day
// Niri config.kdl
Mod+W hotkey-overlay-title="sunsetr gaming toggle" { spawn "sh" "-c" "sunsetr p gaming"; }

Configuration: Create preset files in ~/.config/sunsetr/presets/ (or with a custom base config directory using --config):

~/.config/sunsetr/
├── .active_preset       # Stores active preset
├── geo.toml             # default geo.toml
├── presets
│   ├── day
│   │   └── sunsetr.toml # static day values
│   ├── gaming
│   │   └── sunsetr.toml # custom static gamma
│   ├── hong_kong
│   │   └── sunsetr.toml # custom geo mode
│   ├── london
│   │   ├── geo.toml     # preset's geo.toml
│   │   └── sunsetr.toml # custom geo mode
│   ├── summer
│   │   ├── geo.toml     # preset's geo.toml
│   │   └── sunsetr.toml # custom geo for summer time
│   └── weekend
│       └── sunsetr.toml # custom manual sunset/sunrise
└── sunsetr.toml         # default config
  • Each preset has the option to use its own geo.toml for private coordinates (using .gitignore) when using geo transition_mode.
  • The active preset is stored in .active_preset. You can manually edit this, but I suggest letting sunsetr handle it to avoid confusion.
  • Running the geo command gives you the option to change the active preset's coordinates (which also respects the preset's geo.toml)
  • Running with --simulate allows you to simulate that preset's runtime during an arbitrary time window (must be active preset)

Note: v0.10.0 will release a config builder that allows you to quickly build new presets automatically. This should simplify making a valid config significantly.

Custom Configuration Directories

  • New --config flag to specify custom configuration directories (#22)
  • Allows for portable configurations and easier testing
  • Full integration with preset system and hot reloading

Usage:

# Use a custom config directory
sunsetr --config ~/dotfiles/sunsetr/

# Commands work with custom directories
sunsetr --config ~/my-configs/sunsetr/ preset weekend
sunsetr --config ~/my-configs/sunsetr/ geo

# Directory structure remains the same
~/my-configs/sunsetr
├── geo.toml
├── presets
│   ├── weekend
│   │   └── sunsetr.toml
│   └── tokyo
│       └── sunsetr.toml
└── sunsetr.toml

Note: If you use a custom base directory, you do not need to keep using the --config flag. Just running it once allows you to use all of the commands (including the new preset command) and they will respect the new base config directory for the life of that process. To switch the base config directory, you will need to stop sunsetr and restart using the new directory. This allows all of the commands to respect the base config directory for the life of the process.

Hot Reloading

  • Live configuration updates without restarting sunsetr (#22)
  • Intelligent file watching that detects changes to your active config files
  • Automatic reload when configuration files are modified
  • Works seamlessly with the new --config flag for custom directories

Usage:

# Start sunsetr - it will auto-reload on config changes
sunsetr

# Or start in background with the reload command
sunsetr reload

# Then:

# Edit your active config - changes apply automatically
vim ~/.config/sunsetr/sunsetr.toml

Note: Hot reloading applies only to the active default config (or active presets) in the active base config directory. For instance, if you run sunsetr --config ~/.custom/sunsetr preset day, then change the values for this config's static_gamma and save, it'll automatically reload the gamma percentage. You would edit this preset in ~/.custom/sunsetr/preset/day/sunsetr.toml

# ~/.custom/sunsetr/preset/day/sunsetr.toml
├── geo.toml
├── presets
│   ├── day
│   │   └── sunsetr.toml # <-- Edit here
│   └── overseas
│       ├── geo.toml
│       └── sunsetr.toml
└── sunsetr.toml

Enhanced Smooth Transitions

  • Comprehensive smooth transitions for both startup and shutdown
  • Configurable startup transition timing with adaptive interval algorithm (An effort to reduce lag for #21)
  • Eliminates jarring gamma changes when starting or stopping
  • Intelligent transition detection prevents redundant gamma resets

Configuration:

#[Smoothing]
smoothing = true         # Enable/disable smooth transitions
startup_duration = 0.5   # Seconds for startup transition (0.1-60, 0=instant)
shutdown_duration = 0.5  # Seconds for shutdown transition (0.1-60, 0=instant)
adaptive_interval = 1    # Base interval for adaptive algorithm (1-1000ms)
  1. startup_transition is now smoothing
  2. startup_transition_duration is now startup_duration
  3. New configurable shutdown_duration for smooth transitions during exit
  4. New adaptive_interval allows user to configure the base interval (floor) from which the adaptive update interval begins scaling. This automatically adjusts to your system's capabilities. Leave at 1ms for the best results and highest granularity.

Note: Changing the adaptive_interval allows you to control the floor the smooth transition intelligently scales up from but will never go lower than. Setting this to higher values like 150(ms) will negate the algorithm's ability to automatically create the smoothest transition, but will allow you to reduce the number of updates for use with longer startup_duration and shutdown_duration values. You may be able to find a sweet spot between compositor rendering lag (affects mouse and other rendering updates) and smoothness of the temp/gamma transition. For longer transitions, you can use something like this:

#[Smoothing]
smoothing = true         # Enable/disable smooth transitions
startup_duration = 5     # Seconds for startup transition (0.1-60, 0=instant)
shutdown_duration = 5    # Seconds for shutdown transition (0.1-60, 0=instant)
adaptive_interval = 150  # Base interval for adaptive algorithm (1-1000ms)

CLI Architecture Improvements

  • Subcommand-based CLI with full backward compatibility
  • Cleaner command organization and better help documentation
  • More intuitive command structure while preserving existing workflows

Technical Improvements

System Monitoring

  • Improved D-Bus signal handling with automatic thread restart on failure
  • Better recovery from system sleep/resume cycles
  • Replaced time anomaly detection with event-driven system monitoring
  • More efficient and reliable detection of system state changes
  • Better handling of sleep/resume events with privacy-focused debug logging

Code Organization

  • Refactored config.rs into a modular structure with separate files for:
    • Configuration building
    • Loading and file operations
    • Validation logic
    • File watching
  • Renamed internal components for clarity (e.g., AdaptiveInterval → AdaptiveThrottle)
  • Simplified constants and removed obsolete code

💛 Acknowledgments

Thanks to all contributors and users who provided feedback and testing for this release. Special thanks for the feature requests and bug reports that shaped these improvements @ItsLemmy and @The-Lost-Light.

v0.8.0

02 Sep 02:08

Choose a tag to compare

sunsetr v0.8.0

This release brings systemd-compliant sleep/resume detection via D-Bus, eliminating the need for root scripts, plus Nix flake support and display hotplug detection from community contributors.

New Features

D-Bus Sleep/Resume Detection

  • Replaced system-sleep scripts with systemd-recommended D-Bus approach
  • Monitors systemd-logind PrepareForSleep signals for automatic resume detection
  • Runs entirely in user space - no root privileges needed
  • Uses zbus blocking API in dedicated thread

Nix Flake Support

  • Official flake.nix for reproducible builds
  • Development shell with all required tools
  • Automatic version detection from Cargo.toml
  • Full integration with Nix ecosystem

Display Hotplug Detection

  • Automatically detects monitor connection/disconnection events
  • Reapplies color temperature when displays change
  • Works across all supported Wayland compositors
  • Hyprland native support coming soon

Breaking Changes

  • System-sleep scripts are no longer installed or needed
  • Sleep/resume detection now requires D-Bus (standard on systemd systems)

For Package Maintainers

  • The system-sleep/ directory has been removed from the source
  • No need to install sleep hooks - D-Bus handles everything
  • Existing sleep hooks will be automatically cleaned up during upgrade

For Nix users:

# Run directly from GitHub
nix run github:psi4j/sunsetr

# Install using nix profile
nix profile install github:psi4j/sunsetr

# For development (from cloned repo)
nix develop

Acknowledgments

Special thanks to:

  • @scottmckendry for contributing Nix flake support and display hotplug detection
  • @jficz for feedback on improving our sleep/resume implementation
  • All contributors and users who provided feedback and testing

Full Changelog

For a complete list of changes, see the full changelog.

v0.7.4 Hotplug Support for Wayland

31 Aug 02:44

Choose a tag to compare

v0.7.4

This update adds monitor hotplug support for the Wayland backend. Special thanks to @scottmckendry for his contribution!

I've got plans for integrating hotplug support for Hyprland as well, but this will come after implementing a proper Hyprland native backend that uses hyprland-ctm-control-v1 directly, allowing for a cleaner abstraction across both protocols.

v0.7.3

25 Aug 06:36

Choose a tag to compare

Systemd Sleep Hook for sunsetr

This update adds a systemd sleep hook, fixes timezone display in simulation mode, and adds some other minor refinements.

When a laptop wakes from sleep (S3/S4 states), the systemd sleep hook:

  1. Detects the running sunsetr process
  2. Sends a SIGUSR2 signal
  3. This triggers immediate state recalculation, fixing the color temperature

Installation

AUR (sunsetr-bin)

Automatically installed during installation:

paru -S sunsetr-bin

Automated Installation (Recommended)

Option 1: Using cargo-make (for source builds)

# Install cargo-make if you haven't already
cargo install cargo-make

# From the project root, install everything
cargo make install

# Or install just the sleep hook
cargo make install-sleep-hook

Option 2: Using the shell script (for releases/packages)

# From the project root
sudo system-sleep/install.sh

Manual Installation

# Copy the hook to systemd's sleep directory
sudo cp system-sleep/sunsetr-resume.sh /usr/lib/systemd/system-sleep/sunsetr-resume

# Make it executable
sudo chmod +x /usr/lib/systemd/system-sleep/sunsetr-resume

How it works

The hook works regardless of how sunsetr is started:

  • Via systemd service (systemctl --user start sunsetr)
  • Manually from terminal (sunsetr)
  • From a desktop environment's autostart
  • Any other method

It uses pgrep to find running sunsetr processes and sends SIGUSR2 to each one, which triggers the existing reload mechanism in sunsetr.

Testing

To test if the hook is working:

  1. Start sunsetr
  2. Note the current color temperature
  3. Suspend your system (close laptop lid, or systemctl suspend)
  4. Wait a few seconds
  5. Resume the system
  6. Check journalctl for confirmation:
    journalctl -t sunsetr-resume -n 5

You should see the color temperature update immediately upon resume instead of waiting for the next scheduled check.

Uninstallation

To remove everything (binary, service, and sleep hook):

cargo make uninstall

Or to remove just the sleep hook manually:

sudo rm /usr/lib/systemd/system-sleep/sunsetr-resume

v0.7.1

16 Aug 02:09

Choose a tag to compare

v0.7.1

This update improves reloading and applies startup transitions more consistently across potential configuration changes.

v0.7.0 Runtime Simulations!

13 Aug 01:44

Choose a tag to compare

sunsetr v0.7.0

This release brings powerful new testing capabilities with the simulate command, expands platform support to NixOS, and includes performance improvements and enhanced logging system.

New Features

Runtime Simulation Mode

  • New --simulate command for testing transitions and geo calculations with accelerated time
  • Supports time multipliers from 0.1x to 3600x speed
  • --fast-forward option for near-instant progression through time windows
  • Optional --log flag saves output to timestamped files for detailed analysis
  • Faithfully reproduces actual runtime behavior including all temp/gamma updates

NixOS Support

  • Now available in nixpkgs unstable repository
  • Multiple installation methods: declarative, imperative, or temporary shell
  • Full integration with NixOS system configuration

Enhanced Logging System

  • Zero-cost abstraction via macros for improved performance
  • Cleaner, more consistent output formatting
  • Better separation of debug and regular logging
  • Reduced overhead in release builds

Progress Bar Enhancements

  • Extracted into reusable component for consistency
  • Added EMA (Exponential Moving Average) smoothing for more stable progress indicators
  • Improved visual feedback during long operations

Geographic Module Refactoring

  • Fixed nanosecond precision timing bugs in transition calculations
  • Improved accuracy of sunrise/sunset computations
  • Better handling of edge cases in extreme latitudes
  • More robust timezone detection and mapping

Bug Fixes

  • Fixed timing precision mismatch between stored times (nanosecond) and duration calculations (second)
  • Resolved state calculation issues in geographic mode
  • Improved lock file handling for simulation mode to prevent conflicts
  • Better cleanup of progress bars on interruption

Usage Examples

Simulation

# Simulate sunset to sunrise at 60x speed
sunsetr --simulate "2025-01-15 18:00:00" "2025-01-16 08:00:00" 60

# Fast-forward through a day
sunsetr --simulate "2025-01-15 06:00:00" "2025-01-15 22:00:00" --fast-forward

# Save detailed logs for analysis
sunsetr --simulate "2025-01-15 18:00:00" "2025-01-16 08:00:00" 60 --log

NixOS Installation

# In configuration.nix
environment.systemPackages = with pkgs; [
  sunsetr
];

💛 Acknowledgments

Special thanks to all contributors, especially @DoctorDalek1963 who packaged sunsetr for NixOS and @danielwerg who provided valuable feedback on bugs and recommended new features (new timestamps in simulation mode!).

Full Changelog

For a complete list of changes, see the full changelog.

v0.6.6 Smoother startup transitions

07 Aug 14:04

Choose a tag to compare

v0.6.6

This update refactors some things for better maintainability and adds some improvements to the startup transitions for the Wayland backend.