Skip to content

Instantly share code, notes, and snippets.

@jonls
Created December 16, 2011 11:20
Show Gist options
  • Save jonls/1485701 to your computer and use it in GitHub Desktop.
Save jonls/1485701 to your computer and use it in GitHub Desktop.
Byoby status script for solar elevation from redshift.
#!/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