Jump to content

Alfred Time - See time passed from your Birthday


nikivi

Recommended Posts

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: 

 

59c07d975e8d2_2017-09-19at04_14.png.f7c0d8700198a79c36ea1397439cc4e3.png

 

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: 

 

59c07a46e1596_2017-09-19at04_00.png.95af6529ef9c2c49068f4e807fcf0e3e.png

 

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 by nikivi
Link to post
  • 2 months later...

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 by nikivi
Link to post
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?

Link to post

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 by nikivi
Link to post
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.

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...