Created
December 16, 2011 11:20
-
-
Save jonls/1485701 to your computer and use it in GitHub Desktop.
Byoby status script for solar elevation from redshift.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# put in ~/.byobu/bin | |
REDSHIFT=/usr/bin/redshift | |
ELEVATION=$($REDSHIFT -pv | grep "Solar elevation" | sed -e 's/.*: //') | |
COLOR=$(echo $ELEVATION | awk '{ if ($0 > 6.0) { printf("gk"); } else if ($0 > -6.0) { printf("yk"); } else { printf("rk"); } }') | |
echo $ELEVATION $COLOR | awk '{ printf("\005{= %s}%.2f\xb0\005{-}\n", $2, $1); }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment