diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 445b35bdf8..82b99d0f90 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -209,12 +209,12 @@ show_setup_security_menu() { } show_setup_config_menu() { - case $(menu "Setup" " Defaults\n Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar\n󰞅 XCompose") in + case $(menu "Setup" " Defaults\n Hyprland\n Hypridle\n Hyprlock\n Sunsetr\n Swayosd\n󰌧 Walker\n󰍜 Waybar\n󰞅 XCompose") in *Defaults*) open_in_editor ~/.config/uwsm/default ;; *Hyprland*) open_in_editor ~/.config/hypr/hyprland.conf ;; *Hypridle*) open_in_editor ~/.config/hypr/hypridle.conf && omarchy-restart-hypridle ;; *Hyprlock*) open_in_editor ~/.config/hypr/hyprlock.conf ;; - *Hyprsunset*) open_in_editor ~/.config/hypr/hyprsunset.conf && omarchy-restart-hyprsunset ;; + *Sunsetr*) open_in_editor ~/.config/sunsetr/sunsetr.toml && omarchy-restart-sunsetr ;; *Swayosd*) open_in_editor ~/.config/swayosd/config.toml && omarchy-restart-swayosd ;; *Walker*) open_in_editor ~/.config/walker/config.toml && omarchy-restart-walker ;; *Waybar*) open_in_editor ~/.config/waybar/config.jsonc && omarchy-restart-waybar ;; @@ -475,9 +475,9 @@ show_update_channel_menu() { esac } show_update_process_menu() { - case $(menu "Restart" " Hypridle\n Hyprsunset\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in + case $(menu "Restart" " Hypridle\n Sunsetr\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in *Hypridle*) omarchy-restart-hypridle ;; - *Hyprsunset*) omarchy-restart-hyprsunset ;; + *Sunsetr*) omarchy-restart-sunsetr ;; *Swayosd*) omarchy-restart-swayosd ;; *Walker*) omarchy-restart-walker ;; *Waybar*) omarchy-restart-waybar ;; @@ -486,11 +486,11 @@ show_update_process_menu() { } show_update_config_menu() { - case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Hyprsunset\n󱣴 Plymouth\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in + case $(menu "Use default config" " Hyprland\n Hypridle\n Hyprlock\n Sunsetr\n󱣴 Plymouth\n Swayosd\n󰌧 Walker\n󰍜 Waybar") in *Hyprland*) present_terminal omarchy-refresh-hyprland ;; *Hypridle*) present_terminal omarchy-refresh-hypridle ;; *Hyprlock*) present_terminal omarchy-refresh-hyprlock ;; - *Hyprsunset*) present_terminal omarchy-refresh-hyprsunset ;; + *Sunsetr*) present_terminal omarchy-refresh-sunsetr ;; *Plymouth*) present_terminal omarchy-refresh-plymouth ;; *Swayosd*) present_terminal omarchy-refresh-swayosd ;; *Walker*) present_terminal omarchy-refresh-walker ;; diff --git a/bin/omarchy-refresh-hyprsunset b/bin/omarchy-refresh-hyprsunset deleted file mode 100755 index 1cbfc5225b..0000000000 --- a/bin/omarchy-refresh-hyprsunset +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# Overwrite the user config for hyprsunset with the Omarchy default and restart the service. -# -omarchy-refresh-config hypr/hyprsunset.conf -omarchy-restart-hyprsunset diff --git a/bin/omarchy-refresh-sunsetr b/bin/omarchy-refresh-sunsetr new file mode 100755 index 0000000000..d36e4053be --- /dev/null +++ b/bin/omarchy-refresh-sunsetr @@ -0,0 +1,5 @@ +#!/bin/bash + +# Reset sunsetr config to Omarchy defaults and restart +omarchy-refresh-config sunsetr/sunsetr.toml +omarchy-restart-sunsetr diff --git a/bin/omarchy-restart-hyprsunset b/bin/omarchy-restart-hyprsunset deleted file mode 100755 index 0e681bfddf..0000000000 --- a/bin/omarchy-restart-hyprsunset +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -omarchy-restart-app hyprsunset diff --git a/bin/omarchy-restart-sunsetr b/bin/omarchy-restart-sunsetr new file mode 100755 index 0000000000..02b67ac728 --- /dev/null +++ b/bin/omarchy-restart-sunsetr @@ -0,0 +1,3 @@ +#!/bin/bash + +omarchy-restart-app sunsetr diff --git a/bin/omarchy-toggle-nightlight b/bin/omarchy-toggle-nightlight index 99b0286b4d..81c9db9c14 100755 --- a/bin/omarchy-toggle-nightlight +++ b/bin/omarchy-toggle-nightlight @@ -1,30 +1,38 @@ #!/bin/bash -# Default temperature values -ON_TEMP=4000 -OFF_TEMP=6000 +# Toggle nightlight (blue light filter) on/off +# +# Default temperatures based on research: +# Day: 6500K - standard monitor calibration, matches noon sunlight +# Night: 3500K - warm light to reduce eye strain and support circadian rhythm +# (consensus default from f.lux research, gammastep, redshift) -# Ensure hyprsunset is running -if ! pgrep -x hyprsunset; then - setsid uwsm-app -- hyprsunset & - sleep 1 # Give it time to register +DAY_TEMP=6500 +NIGHT_TEMP=3500 + +# Start sunsetr if not running +if ! pgrep -x sunsetr >/dev/null; then + setsid uwsm-app -- sunsetr & + sleep 1 fi -# Query the current temperature -CURRENT_TEMP=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+') +# Get current temperature +CURRENT_TEMP=$(sunsetr get static_temp 2>/dev/null | grep -oE '[0-9]+' || echo "$DAY_TEMP") restart_nightlighted_waybar() { - if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc; then - omarchy-restart-waybar # restart waybar in case user has waybar module for hyprsunset + if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc 2>/dev/null; then + omarchy-restart-waybar fi } -if [[ "$CURRENT_TEMP" == "$OFF_TEMP" ]]; then - hyprctl hyprsunset temperature $ON_TEMP - notify-send " Nightlight screen temperature" +if [[ "$CURRENT_TEMP" -ge "$DAY_TEMP" ]]; then + # Currently day temp (or higher) -> switch to night + sunsetr set static_temp=$NIGHT_TEMP + notify-send " Nightlight on (${NIGHT_TEMP}K)" restart_nightlighted_waybar else - hyprctl hyprsunset temperature $OFF_TEMP - notify-send " Daylight screen temperature" + # Currently night temp -> switch to day + sunsetr set static_temp=$DAY_TEMP + notify-send " Nightlight off (${DAY_TEMP}K)" restart_nightlighted_waybar fi diff --git a/config/hypr/hyprsunset.conf b/config/hypr/hyprsunset.conf deleted file mode 100644 index c4d0f8d3c3..0000000000 --- a/config/hypr/hyprsunset.conf +++ /dev/null @@ -1,14 +0,0 @@ -# Makes hyprsunset do nothing to the screen by default -# Without this, the default applies some tint to the monitor -profile { - time = 07:00 - identity = true -} - -# To enable auto switch to nightlight, set in your .config/hypr/autostart: -# exec-once = uwsm app -- hyprsunset -# and use the following: -# profile { -# time = 20:00 -# temperature = 4000 -# } diff --git a/config/sunsetr/sunsetr.toml b/config/sunsetr/sunsetr.toml new file mode 100644 index 0000000000..c59cf1c083 --- /dev/null +++ b/config/sunsetr/sunsetr.toml @@ -0,0 +1,59 @@ +# Sunsetr - Blue light filter for Wayland +# https://github.com/disluckyguy/sunsetr +# +# Sunsetr is NOT started automatically. To enable: +# 1. Manual toggle: Press SUPER+CTRL+N or use Omarchy Menu > Trigger > Toggle > Nightlight +# 2. Auto-start: Add to ~/.config/hypr/autostart.conf: +# exec-once = uwsm-app -- sunsetr +# +# After enabling, sunsetr will automatically adjust color temperature +# based on your location and time of day (geo mode) or your manual settings. + +# Backend selection +# Options: "auto", "hyprland", "hyprsunset", "wayland" +backend = "auto" + +# Transition mode - how color temperature changes throughout the day +# Options: +# "geo" - Automatic based on sunrise/sunset at your location (recommended) +# "static" - Fixed temperature, no automatic changes +# "finish_by" - Transition completes by sunset/sunrise time +# "start_at" - Transition starts at sunset/sunrise time +# "center" - Transition centered on sunset/sunrise time +transition_mode = "static" + +# Static mode settings (used when transition_mode = "static") +# Standard daylight is 6500K - this means no color shift when first started +static_temp = 6500 +static_gamma = 100 + +# Day/Night temperatures (used in geo and time-based modes) +# Research-based defaults: +# - 6500K: Standard monitor calibration, matches noon sunlight +# - 3500K: Warm incandescent, reduces blue light for evening use +# (consensus default from f.lux research, gammastep, redshift) +day_temp = 6500 +night_temp = 3500 + +# Gamma adjustment (10-200%) +# 100% = no change, lower = dimmer +# Research suggests 80-90% at night can help, but 100% is simpler +day_gamma = 100 +night_gamma = 100 + +# Smooth transitions +smoothing = true +startup_duration = 0.5 # Seconds to fade in on start (0.1-60, 0 = instant) +shutdown_duration = 0.5 # Seconds to fade out on stop (0.1-60, 0 = instant) +adaptive_interval = 1 # Base interval for smooth transitions (1-1000ms) + +# Transition timing (for time-based modes) +update_interval = 60 # How often to update during transitions (10-300 seconds) +transition_duration = 45 # Length of dawn/dusk transition (5-120 minutes) + +# Manual sunrise/sunset times (used if geo mode can't determine location) +sunrise = "06:00:00" +sunset = "19:00:00" + +# Geolocation is auto-detected on first run when using geo mode. +# To set manually, run: sunsetr geo diff --git a/default/omarchy-skill/SKILL.md b/default/omarchy-skill/SKILL.md index d8d85607bd..b68dc6427f 100644 --- a/default/omarchy-skill/SKILL.md +++ b/default/omarchy-skill/SKILL.md @@ -119,8 +119,7 @@ cat $(which omarchy-theme-set) ├── envs.conf # Environment variables ├── autostart.conf # Startup applications ├── hypridle.conf # Idle behavior (screen off, lock, suspend) -├── hyprlock.conf # Lock screen appearance -└── hyprsunset.conf # Night light / blue light filter +└── hyprlock.conf # Lock screen appearance ``` **Key behaviors:** @@ -159,6 +158,7 @@ cat $(which omarchy-theme-set) | lazygit | `~/.config/lazygit/config.yml` | | starship | `~/.config/starship.toml` | | git | `~/.config/git/config` | +| sunsetr | `~/.config/sunsetr/sunsetr.toml` | | walker | `~/.config/walker/config.toml` | ## Safe Customization Patterns @@ -363,7 +363,7 @@ This creates a new migration file and outputs its path without opening an editor - "Add a keybinding for Super+E to open file manager" -> Check existing bindings first, add `unbind` if needed, then add `bind` in `~/.config/hypr/bindings.conf` - "Configure my external monitor" -> Edit `~/.config/hypr/monitors.conf` - "Make the window gaps smaller" -> Edit `~/.config/hypr/looknfeel.conf` -- "Set up night light to turn on at sunset" -> `omarchy-toggle-nightlight` or edit `~/.config/hypr/hyprsunset.conf` +- "Set up night light to turn on at sunset" -> `omarchy-toggle-nightlight` or edit `~/.config/sunsetr/sunsetr.toml` - "Customize the catppuccin theme colors" -> Create `~/.config/omarchy/themes/catppuccin-custom/` by copying from stock, then edit - "Run a script every time I change themes" -> Create `~/.config/omarchy/hooks/theme-set` - "Reset waybar to defaults" -> `omarchy-refresh-waybar` diff --git a/install/omarchy-base.packages b/install/omarchy-base.packages index 7373e0f1dc..d41ce05e9d 100644 --- a/install/omarchy-base.packages +++ b/install/omarchy-base.packages @@ -52,7 +52,7 @@ hyprland-guiutils hyprland-preview-share-picker hyprlock hyprpicker -hyprsunset +sunsetr imagemagick impala imv diff --git a/migrations/1767914078.sh b/migrations/1767914078.sh new file mode 100644 index 0000000000..d6d0aa0c72 --- /dev/null +++ b/migrations/1767914078.sh @@ -0,0 +1,20 @@ +echo "Switch from hyprsunset to sunsetr for blue light filtering" + +# Install sunsetr from AUR +if ! command -v sunsetr &>/dev/null; then + yay -S --noconfirm --needed sunsetr +fi + +# Stop hyprsunset if running +pkill -x hyprsunset 2>/dev/null || true + +# Remove hyprsunset package (if installed) +if pacman -Qi hyprsunset &>/dev/null; then + sudo pacman -Rns --noconfirm hyprsunset 2>/dev/null || true +fi + +# Remove old config +rm -f ~/.config/hypr/hyprsunset.conf + +# Install new sunsetr config +omarchy-refresh-sunsetr