Skip to content

Instantly share code, notes, and snippets.

@tannerkrewson
Last active January 11, 2020 05:37
Show Gist options
  • Save tannerkrewson/4c967814f940aa102cf5744a5cec7f8b to your computer and use it in GitHub Desktop.
Save tannerkrewson/4c967814f940aa102cf5744a5cec7f8b to your computer and use it in GitHub Desktop.
kustom bedtime widget 2.0 w/global variables and auto hide
$if(gv(hours)<gv(maxcnt), "Bed time" + if(df(S)<=(si(alarmd)-gv(sleeptm)), " in") + if(gv(hours)>0, " "+gv(hours) + " hour" + if(gv(hours)!=1,"s") + " and") + " " + mu(round, (gv(mins)-(gv(hours)))*60, 0) + " minute" + if(mu(round, (gv(mins)-(gv(hours)))*60, 0)!=1, "s") + " " + if(df(S)>(si(alarmd)-gv(sleeptm)), "ago"))$
hours = $mu(round, mu(abs, df(S)-si(alarmd)+gv(sleeptm))/3600-.5, 0)$
mins = $(mu(abs, df(S)-si(alarmd)+gv(sleeptm))/3600)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment