nikivi Posted September 19, 2017 Posted September 19, 2017 (edited) Alfred Birthday This is a simple workflow that shows you how much time has passed since your birthday. This is how the workflow looks like for me: For you this might be different. But you can never be certain. In order to use this workflow, you first have to set your birthday as alfred environment variable here: In the future I hope to make that process simpler. Hopefully it helps you be more aware of time passed. At least that's the goal. Hope you like it. ? Download Edited February 27, 2018 by nikivi
nikivi Posted September 19, 2017 Author Posted September 19, 2017 Oops. I did a silly mistake and it actually didn't use the date you pass in as variable. Now it does and works perfectly well. You can grab the latest version from GitHub or wait a bit if you installed my initial version. Sorry about that.
nikivi Posted November 28, 2017 Author Posted November 28, 2017 I was thinking. Would it be possible to somehow have the seconds item ticking in real time? Without having to type things to update it?
deanishe Posted November 28, 2017 Posted November 28, 2017 1 hour ago, nikivi said: Would it be possible to somehow have the seconds item ticking in real time? Yes. rerun.
nikivi Posted December 1, 2017 Author Posted December 1, 2017 (edited) Made the change. Now seconds are ticking. Not sure if I added Rerun to correct place. Here is where I put it. I was thinking of only evaluating the last item in the script filter and not actually rerunning the entire script filter every second. So I wanted to just add 1 to the last item every second. Edited December 1, 2017 by nikivi
deanishe Posted December 1, 2017 Posted December 1, 2017 7 hours ago, nikivi said: Not sure if I added Rerun to correct place Not really. Where you've added it means Alfred will re-run the Script Filter regardless, e.g. also when it's showing "Please add your date of birth…". It should be in this else-clause. 7 hours ago, nikivi said: I was thinking of only evaluating the last item in the script filter and not actually rerunning the entire script filter every second. Alfred re-runs the entire Script Filter. How else could it possibly work? nikivi 1
nikivi Posted December 1, 2017 Author Posted December 1, 2017 (edited) I was thinking to somehow only rerun this line and leave all other items as they are. I will cache all other items but minutes and seconds and update them only when time comes. I just feel bad for having to calculate all the fields just to update the seconds. Edited December 1, 2017 by nikivi
deanishe Posted December 1, 2017 Posted December 1, 2017 32 minutes ago, nikivi said: I will cache all other items but minutes and seconds and update them only when time comes. Bad idea. Reading and writing a file will take far, far longer than recalculating the values. What you're doing wrong is running time.Since(birthDate) six times instead of doing d := time.Since(birthDate) once. nikivi 1
nikivi Posted December 1, 2017 Author Posted December 1, 2017 Thank you a lot @deanishe Released new version with the changes ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now