Allow set_warmth to accept minutes, making for a more gradual change in temperature.

master
Mid Favila 9 months ago
parent 9b3d85b3ba
commit 52a92af54e
  1. 13
      set_warmth

@ -1,11 +1,14 @@
#!/bin/sh -e
# Get current hour.
x=$(date|cut -f5 -d' '|cut -f1 -d:)
brownout $(bc -e "define redlevel(x) {
# Get current minute.
y=$(date|cut -f5 -d' '|cut -f2 -d:)
brownout $(bc -e "define redlevel(x,y) {
if((x-12) <= 0)
return((83*(12-x)))
return((83*(12-x)+(y*(83/60))))
else
return((83*(x-12)))
} redlevel($x)")
return((83*(x-12)+(y*(83/60))))
} redlevel($x, $y)")

Loading…
Cancel
Save