diff --git a/bin/omarchy-toggle-nightlight b/bin/omarchy-toggle-nightlight new file mode 100755 index 0000000..5894686 --- /dev/null +++ b/bin/omarchy-toggle-nightlight @@ -0,0 +1,22 @@ +#!/bin/bash + +# Default temperature values +ON_TEMP=4000 +OFF_TEMP=6500 + +# Query the current temperature +CURRENT_TEMP=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+') + +if [[ "$CURRENT_TEMP" == "$OFF_TEMP" ]]; then + hyprctl hyprsunset temperature $ON_TEMP + notify-send " Nightlight On" + if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc; then + omarchy-restart-waybar # restart waybar in case user has waybar module for hyprsunset + fi +else + hyprctl hyprsunset temperature $OFF_TEMP + notify-send " Nightlight Off" + if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc; then + omarchy-restart-waybar # restart waybar in case user has waybar module for hyprsunset + fi +fi \ No newline at end of file diff --git a/config/hypr/hyprsunset.conf b/config/hypr/hyprsunset.conf new file mode 100644 index 0000000..1827445 --- /dev/null +++ b/config/hypr/hyprsunset.conf @@ -0,0 +1,6 @@ +# Makes hyprsunset do nothing to the screen by default +# Without this, the default applies some tint to the monitor +profile { + time = 00:00 + identity = true +} \ No newline at end of file diff --git a/default/hypr/autostart.conf b/default/hypr/autostart.conf index ae9b084..72e64af 100644 --- a/default/hypr/autostart.conf +++ b/default/hypr/autostart.conf @@ -2,6 +2,7 @@ exec-once = uwsm app -- hypridle exec-once = uwsm app -- mako exec-once = uwsm app -- waybar exec-once = uwsm app -- fcitx5 +exec-once = uwsm app -- hyprsunset exec-once = uwsm app -- swaybg -i ~/.config/omarchy/current/background -m fill exec-once = uwsm app -- swayosd-server exec-once = uwsm app -- walker --gapplication-service diff --git a/default/hypr/bindings/utilities.conf b/default/hypr/bindings/utilities.conf index fe449cc..073f2b3 100644 --- a/default/hypr/bindings/utilities.conf +++ b/default/hypr/bindings/utilities.conf @@ -18,6 +18,9 @@ bind = SUPER, ESCAPE, exec, ~/.local/share/omarchy/bin/omarchy-menu-power # Toggle idling bind = SUPER CTRL, I, exec, ~/.local/share/omarchy/bin/omarchy-toggle-idle +# Toggle nightlight +bind = SUPER CTRL, N, exec, ~/.local/share/omarchy/bin/omarchy-toggle-nightlight + # Control Apple Display brightness bind = CTRL, F1, exec, ~/.local/share/omarchy/bin/omarchy-cmd-apple-display-brightness -5000 bind = CTRL, F2, exec, ~/.local/share/omarchy/bin/omarchy-cmd-apple-display-brightness +5000 diff --git a/install/desktop/hyprlandia.sh b/install/desktop/hyprlandia.sh index e5d9368..5a7e916 100644 --- a/install/desktop/hyprlandia.sh +++ b/install/desktop/hyprlandia.sh @@ -1,6 +1,6 @@ #!/bin/bash yay -S --noconfirm --needed \ - hyprland hyprshot hyprpicker hyprlock hypridle polkit-gnome hyprland-qtutils \ + hyprland hyprshot hyprpicker hyprlock hypridle hyprsunset polkit-gnome hyprland-qtutils \ walker-bin libqalculate waybar mako swaybg swayosd \ xdg-desktop-portal-hyprland xdg-desktop-portal-gtk diff --git a/migrations/1754109724.sh b/migrations/1754109724.sh new file mode 100644 index 0000000..cdb9fe4 --- /dev/null +++ b/migrations/1754109724.sh @@ -0,0 +1,7 @@ +echo "Add hyprsunset blue light filter" +if ! command -v hyprsunset &>/dev/null; then + yay -S --noconfirm --needed hyprsunset +fi +cp -r ~/.local/share/omarchy/config/hypr/hyprsunset.conf ~/.config/hypr/ +pkill hyprsunset +setsid uwsm app -- hyprsunset &>/dev/null & \ No newline at end of file