Skip to content

Instantly share code, notes, and snippets.

@fsmithred
Created May 25, 2017 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fsmithred/e8cb0ca2d0a3a0df642724f373ab8933 to your computer and use it in GitHub Desktop.
Save fsmithred/e8cb0ca2d0a3a0df642724f373ab8933 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# redshifty2
# run one-shot redshift with desired settings
selection=$(yad --list --title redshifty2 --text "Set screen temperature and brightness" \
--checklist --column "" --column "tempK bright%" --height 460 \
--separator " " --button=$"OK":0 --button=$"Cancel":1 \
FALSE "6800 95" \
FALSE "6300 95" \
FALSE "6300 85" \
FALSE "6000 85" \
FALSE "5800 90" \
FALSE "5800 80" \
FALSE "5800 70" \
FALSE "5300 80" \
FALSE "5300 70" \
FALSE "5300 60" \
FALSE "4800 70" \
FALSE "4800 60" \
FALSE "4800 50" \
FALSE "4300 60" \
FALSE "4300 50" \
FALSE "4300 40" \
FALSE "3800 50" \
FALSE "3800 40")
ret="$?"
if [[ $ret -eq 1 ]] ; then
exit 0
fi
TEMP=$(echo "$selection" | cut -d" " -f2)
BRIGHT=$(echo "$selection" | cut -d" " -f3)
# uncomment if you're using both redshifty and redshifty2
#if [[ -f /tmp/redshifty.log ]] ; then echo "$TEMP 0.${BRIGHT}" > /tmp/redshifty.log ; fi
redshift -O "$TEMP" -b "0.${BRIGHT}"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment