2025-08-03 04:26:59 -04:00
|
|
|
#!/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]+')
|
|
|
|
|
2025-08-03 10:44:45 +02:00
|
|
|
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
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2025-08-03 04:26:59 -04:00
|
|
|
if [[ "$CURRENT_TEMP" == "$OFF_TEMP" ]]; then
|
|
|
|
hyprctl hyprsunset temperature $ON_TEMP
|
2025-08-03 11:02:14 +02:00
|
|
|
notify-send " Nightlight screen temperature"
|
2025-08-03 10:44:45 +02:00
|
|
|
restart_nightlighted_waybar
|
2025-08-03 04:26:59 -04:00
|
|
|
else
|
|
|
|
hyprctl hyprsunset temperature $OFF_TEMP
|
2025-08-03 11:02:14 +02:00
|
|
|
notify-send " Daylight screen temperature"
|
2025-08-03 10:44:45 +02:00
|
|
|
restart_nightlighted_waybar
|
|
|
|
fi
|
|
|
|
|