hypr/.scripts/redshift.sh
2025-03-08 19:35:35 +01:00

31 lines
812 B
Bash
Executable file

#!/bin/bash --norc
# Check if the given command exists silently
command_exists() {
command -v "$@" >/dev/null 2>&1
}
_rdshft() {
# color temperature for redshift
local temp="5200"
if command_exists redshift; then
pkill redshift redshift
sleep 1
pkill redshift redshift-gtk &&
redshift -P -O "$temp"
# redshift -P -O "$temp"
# Check if redshift is running
sleep 2
if ! pgrep -x redshift-gtk >/dev/null && ! pgrep -x redshift >/dev/null; then
notify-send -u critical "ERROR" "Redshift failed to start. Please check your configuration."
else
notify-send -u normal "INFO" "Redshift started successfully."
fi
else
notify-send -u critical "ERROR" "Redshift is not installed. Please install it for better screen color management."
fi
}
_rdshft