diff --git a/README.md b/README.md index 9aa8633..b99bdac 100644 --- a/README.md +++ b/README.md @@ -13,5 +13,5 @@ has a unix socket (`/tmp/hinoirisetr.sock`) that accepts four commands ## TODO -- [ ] fix `status` command crash -- [ ] handle signals +- [x] fix `status` command crash +- [x] handle signals diff --git a/manpages/hinoirisetr.1.md b/manpages/hinoirisetr.1.md new file mode 100644 index 0000000..3e05e3f --- /dev/null +++ b/manpages/hinoirisetr.1.md @@ -0,0 +1,110 @@ +% hinoirisetr(1) +% Vladimir Rubin +% May 2025 + +# NAME + +**hinoirisetr** — automatic display gamma & temperature adjuster with live config reload and control socket + +# SYNOPSIS + +**hinoirisetr** [options] + +# DESCRIPTION + +**hinoirisetr** runs as a daemon that automatically adjusts display gamma and color temperature based on time of day. When launched without arguments: + +1. Loads configuration from the default path +2. Applies settings according to local time and config sections +3. Watches for config changes every 5 s +4. Listens on a Unix socket for control commands + +Environment variables: + +- `RUST_LOG` - Set log level (e.g., `export RUST_LOG=debug`) + +# CONFIGURATION + +The config file uses INI-style syntax with sections and key-value pairs. Comments begin with `#`. Default location: + +```text +$XDG_CONFIG_HOME/hinoirisetr.toml +# or ~/.config/hinoirisetr.toml +``` + +If not found, the daemon emits a warning and uses built-in defaults. + +## Global Options + +- **notification_timeout** + Timeout in milliseconds for desktop notifications. + +- **gamma_backend** + One of: `hyprctl`, `ddcutil`, `gammastep`, `xsct`, `redshift`, `none`. + +- **temp_backend** + One of: `hyprctl`, `gammastep`, `xsct`, `redshift`, `none`. + +## Section `[gamma]` + +- **day** + Gamma percentage for daytime (0–100). + +- **night** + Gamma percentage for nighttime (0–100). + +## Section `[temp]` + +- **day** + Color temperature in Kelvin for daytime (1000–20000). + +- **night** + Color temperature in Kelvin for nighttime (1000–20000). + +## Section `[time]` + +All values in hours (0–23): + +- **sunset_start** +- **sunset_end** +- **sunrise_start** +- **sunrise_end** + +# CONTROL SOCKET + +Unix socket at `/tmp/hinoirisetr.sock` accepts newline-terminated commands: + +- **disable** + Pause automatic adjustments; keeps current settings. + +- **enable** + Resume automatic adjustments. + +- **toggle** + Switch between enabled/disabled states. + +- **status** + Returns current state: + `dimming is – temp: K, gamma: <%>` + +- **reload** + Force immediate config reload. + +- **status_notify** + Send desktop notification with current settings (or "disabled"). + +# FILES + +- Configuration: `$XDG_CONFIG_HOME/hinoirisetr.toml` +- Socket: `/tmp/hinoirisetr.sock` + +# SIGNALS + +- **SIGINT/SIGTERM** + Clean shutdown (removes socket file). + +# SEE ALSO + +[redshift(1)](https://man.archlinux.org/man/redshift.1), +[gammastep(1)](https://man.archlinux.org/man/gammastep.1), +[hyprctl(1)](https://wiki.hyprland.org/Options/)