mirror of
https://github.com/basecamp/omarchy.git
synced 2025-08-04 07:39:24 +00:00
22 lines
725 B
Plaintext
22 lines
725 B
Plaintext
![]() |
#!/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
|