Jump to content

Alfred Time - See time passed from your Birthday


Recommended Posts

Posted (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: 

 

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
Posted

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.

  • 2 months later...
Posted

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? 

Posted (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 by nikivi
Posted
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?

Posted (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 by nikivi
Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...