You are not logged in.
What are some of your scripts or reasons for doing scripts?
e, the values im adjusting still. probably the day time values will be adjusted to be cooler.
#!/bin/bash
# Check if xsct is installed
if ! command -v xsct &> /dev/null
then
echo "Error: xsct not found."
exit 1
fi
# Retrieve the current hour (0-23) and adjust the temperature accordingly
current_hour=$(date +%H)
current_min=$(date +%M)
while true; do
new_temperature=4000
if (( $current_hour < 12 )); then
if (( $current_min < 14)); then
new_temperature=6500
elif (( $current_min < 29)); then
new_temperature=6400
elif (( $current_min < 44)); then
new_temperature=6300
elif (( $current_min < 59)); then
new_temperature=6100
fi
elif (( $current_hour < 13 )); then
if (( $current_min < 14)); then
new_temperature=6000
elif (( $current_min < 29)); then
new_temperature=5900
elif (( $current_min < 44)); then
new_temperature=5900
elif (( $current_min < 59)); then
new_temperature=5900
fi
elif (( $current_hour < 14 )); then
if (( $current_min < 14)); then
new_temperature=5800
elif (( $current_min < 29)); then
new_temperature=5800
elif (( $current_min < 44)); then
new_temperature=5750
elif (( $current_min < 59)); then
new_temperature=5750
fi
elif (( $current_hour < 15 )); then
if (( $current_min < 14)); then
new_temperature=5650
elif (( $current_min < 29)); then
new_temperature=5600
elif (( $current_min < 44)); then
new_temperature=5600
elif (( $current_min < 59)); then
new_temperature=5500
fi
elif (( $current_hour < 16 )); then
if (( $current_min < 14)); then
new_temperature=4800
elif (( $current_min < 29)); then
new_temperature=4700
elif (( $current_min < 44)); then
new_temperature=4600
elif (( $current_min < 59)); then
new_temperature=4500
fi
elif (( $current_hour < 17 )); then
if (( $current_min < 14)); then
new_temperature=4400
elif (( $current_min < 29)); then
new_temperature=4300
elif (( $current_min < 44)); then
new_temperature=4200
elif (( $current_min < 59)); then
new_temperature=4100
fi
elif (( $current_hour < 18 )); then
if (( $current_min < 14)); then
new_temperature=4000
elif (( $current_min < 29)); then
new_temperature=3900
elif (( $current_min < 44)); then
new_temperature=3800
elif (( $current_min < 59)); then
new_temperature=3700
fi
elif (( $current_hour < 19 )); then
if (( $current_min < 14)); then
new_temperature=3600
elif (( $current_min < 29)); then
new_temperature=3500
elif (( $current_min < 44)); then
new_temperature=3500
elif (( $current_min < 59)); then
new_temperature=3350
fi
elif (( $current_hour < 20 )); then
if (( $current_min < 14)); then
new_temperature=3200
elif (( $current_min < 29)); then
new_temperature=3100
elif (( $current_min < 44)); then
new_temperature=3050
elif (( $current_min < 59)); then
new_temperature=3000
fi
elif (( $current_hour < 21 )); then
if (( $current_min < 14)); then
new_temperature=2900
elif (( $current_min < 29)); then
new_temperature=2800
elif (( $current_min < 44)); then
new_temperature=2700
elif (( $current_min < 59)); then
new_temperature=2650
fi
elif (( $current_hour < 22 )); then
if (( $current_min < 14)); then
new_temperature=2500
elif (( $current_min < 29)); then
new_temperature=2300
elif (( $current_min < 44)); then
new_temperature=2200
elif (( $current_min < 59)); then
new_temperature=2100
fi
elif (( $current_hour < 23 )); then
if (( $current_min < 14)); then
new_temperature=2000
elif (( $current_min < 29)); then
new_temperature=1900
elif (( $current_min < 44)); then
new_temperature=1850
elif (( $current_min < 59)); then
new_temperature=1800
fi
elif (( $current_hour < 24 )); then
if (( $current_min < 14)); then
new_temperature=1700
elif (( $current_min < 29)); then
new_temperature=1600
elif (( $current_min < 44)); then
new_temperature=1550
elif (( $current_min < 59)); then
new_temperature=1400
fi
elif (( $current_hour = 24 )); then
new_temperature=1350
fi
# Call xsct to adjust the screen temperature
echo "Adjusting screen temperature to $new_temperature K."
xsct $new_temperature
sleep 150
done
Added later 10 h 47 min 04 s:
there is an edit to under the line "if (( $current_hour < 12 )); then"
it should have a line that says "new_temperature=6500"
Last edited by forest_essential (2024-09-30 01:40:41)
Offline
[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 530.32 KiB (Peak: 537.62 KiB) ]