Jump to content

EggTimer v2 [updated to 2.0 final]


Recommended Posts

On 7/12/2017 at 7:36 PM, Basket said:

Just tried "timer nuke" and I'm unfortunately still having the same problem, I'm on High Sierra so that may be causing some kind of issue? Thanks for the suggestion by the way, I really appreciate it!

 

The same issue here using El Captain :/

Link to comment
  • 3 months later...

Here is my own custom version : https://github.com/lucianosantana/EggTimer2  (based on the updated version for Alfred 3 by @ianhowson)


For the issues with the notification I had to change the notify_functions.sh .
I've completely erased the original and added the following : 

notify () {

if [ "$5" = alarm ]; then
	nc_icon="$PWD/resources/icon_alarm.icns"
else
	nc_icon="$PWD/resources/icon.icns"
fi

osascript <<EOD
set img to POSIX file "$nc_icon"
display dialog "$3\n$4" with title "$1" with icon img buttons {"OK"}
EOD

}

I'm using AppleScript to display a Dialog (not a notification). This way the message sticks on the screen until I interact with it and I don't loose the reminder if I'm temporarily away.

I also had to invert the order of execution of the sound and alert. Originally it executes the notification then the sound. But changing the notification to dialog blocks the script execution, therefore the sounds executes after user interaction. To solve this issue just search for 

afplay sounds/alarm_done.mp3 &

in the files timer_alarm.sh , timer_auto.sh and timer.sh . Then move it just before the notify command.


Might be helpful for you @Basket and @Dzier .
 

 

Link to comment
  • 2 weeks later...

Hey @Luciano Santana, I love what you did with this workflow. Was thinking that it'd be nice to be able to trigger additional timers from the pop-up window...any ideas on how to accomplish that? Would it be easy to assign additional buttons to the task(s)?

 

For example, setting timer for '25 Are you still working?' and having the option to set an additional 25 min by clicking 'Yes' (context-specific) or '25 min' or whatever on pop-up window...

Link to comment
  • 4 weeks later...
  • 4 weeks later...
On 5/17/2018 at 2:35 PM, Russell Davis said:

@Luciano Santana (and anyone else following along), there are a few commands (Create New Timer, Create New Alarm, and View Recent) that are still broken in Alfred 3. I have a branch that fixes them. (I also submitted a PR to Luciano's repo.)

 

Super newbie question -- how do I add this branch into Alfred as a workflow?

 

Also, to anyone reading, I could use some help integrating parts of this workflow into another. Right now, I start work by typing "start work", and the apps I use open and the webpages I need to start with also open. I'd like have my "start work" command also start a repeating 30 minute timer to remind me to take a break. Anyone know how I could do that within the workflow manager?

Link to comment
13 hours ago, Chamend said:

how do I add this branch into Alfred as a workflow?

 

Download the zip file from the repo (Clone or download > Download ZIP) and extract it. Go into the new directory, select all the files, right-click and choose "Compress 11 Items". That will create Archive.zip. change the name to Archive.alfredworkflow and double-click it.

 

Link to comment
  • 7 months later...
  • 1 month later...
  • 3 months later...
On 6/16/2018 at 10:18 AM, deanishe said:

 

Download the zip file from the repo (Clone or download > Download ZIP) and extract it. Go into the new directory, select all the files, right-click and choose "Compress 11 Items". That will create Archive.zip. change the name to Archive.alfredworkflow and double-click it.

 

 

It seems that @Russell Davis version runs fine in Alfred 4. However it expects its workflow data at the old Alfred 3 path ("$HOME/Library/Application Support/Alfred 3/Workflow Data/carlosnz.eggtimer2").

So, @deanishe, if I follow your instructions to download and extract the ZIP file, then replace all occurrences with the new path, create a new ZIP and rename it – then it should be fine? I mean, I’ve got no experience at all in workflow development, so basically my question is: Is this all that it takes to modify an existing workflow?

Link to comment
  • 1 month later...

It's not working in alfred4 because the directories in the "include.sh" doesn't exist anymore.

 

_______________

Edit: I managed to make it work in Alfred 4.

 

After installing the workflow, open it in finder to find where it was installed. Then edit the scripts to fix the old directories. Don't just copy and paste what posted here since the dir is dependent on your user account.

 

include.sh:

 

EGGPREFS="/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC"

 

EGGWD="/Users/<your account>/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC"

 

I'm not sure if naming it the same as the workflow is necessary. But I made the folder in the Cache then edited the include.sh file. That's probably an unnecessary step since the first_install.sh has mkdir "$EGGWD" line in it.

 

first_run_check.sh

 

"/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC/version"

 

a file called version will be created by the first_install.sh

 

login_check.workflow - This will open in automator

 

"/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC/eggwd.txt"

 

eggwd.txt is again a file that will be created by first_install.sh

Edited by runaway
added fix
Link to comment
  • 2 weeks later...
On 8/22/2019 at 12:23 PM, runaway said:

It's not working in alfred4 because the directories in the "include.sh" doesn't exist anymore.

 

_______________

Edit: I managed to make it work in Alfred 4.

 

After installing the workflow, open it in finder to find where it was installed. Then edit the scripts to fix the old directories. Don't just copy and paste what posted here since the dir is dependent on your user account.

 

include.sh:

 

EGGPREFS="/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC"

 

EGGWD="/Users/<your account>/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC"

 

I'm not sure if naming it the same as the workflow is necessary. But I made the folder in the Cache then edited the include.sh file. That's probably an unnecessary step since the first_install.sh has mkdir "$EGGWD" line in it.

 

first_run_check.sh

 

"/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC/version"

 

a file called version will be created by the first_install.sh

 

login_check.workflow - This will open in automator

 

"/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC/eggwd.txt"

 

eggwd.txt is again a file that will be created by first_install.sh

 

I can confirm that this fix works for me in Alfred 4 on OSX 10.14.  The user.workflow.##### folder was different for me, just find the one corresponding to EggTimer.  Thanks for the fix!

Link to comment
  • 2 weeks later...
On 8/22/2019 at 7:23 PM, runaway said:

It's not working in alfred4 because the directories in the "include.sh" doesn't exist anymore.

 

_______________

Edit: I managed to make it work in Alfred 4.

 

After installing the workflow, open it in finder to find where it was installed. Then edit the scripts to fix the old directories. Don't just copy and paste what posted here since the dir is dependent on your user account.

 

include.sh:

 

EGGPREFS="/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC"

 

EGGWD="/Users/<your account>/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC"

 

I'm not sure if naming it the same as the workflow is necessary. But I made the folder in the Cache then edited the include.sh file. That's probably an unnecessary step since the first_install.sh has mkdir "$EGGWD" line in it.

 

first_run_check.sh

 

"/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC/version"

 

a file called version will be created by the first_install.sh

 

login_check.workflow - This will open in automator

 

"/Users/<your account>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.B8A3F635-78EA-479E-8EE1-6AEE187E68FC/eggwd.txt"

 

eggwd.txt is again a file that will be created by first_install.sh

 

I'm using dropbox to sync prefs between computers and the workflow folders seem to be residing there, as alfred directs me there when I want to see workflow files.

 

So my question is: Do you use syncing? Should we assign the folders in dropbox  (ie.

~/Dropbox/AlfredSync/Alfred.alfredpreferences/

 instead of

~/Library/Application Support/Alfred/Alfred.alfredpreferences/

) if we want to edit those files? Any ideas? 

Link to comment
  • 1 month later...
On 4/3/2019 at 1:59 PM, akaralar said:

the `recent` option seems broken for me, even in the version @Russell Davis provided, on macOS 10.14 Mojave. I can't see the alarms I'm setting after typing `recent`, it says there are no alarms or timers set. 

Does anybody else have the same problem?

 

Hey I am experiencing the exact same issue on the most recent versions of OSX and Alfred. Has someone found a way to fix that?

 

EDIT:

Ok found the bug rather quickly:

change `EGGWD` in your includes.sh

For Alfred 4: 

EGGWD="$HOME/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/carlosnz.eggtimer2"
Edited by tillus
Link to comment
  • 11 months later...
On 11/8/2019 at 11:57 AM, tillus said:

 

Hey I am experiencing the exact same issue on the most recent versions of OSX and Alfred. Has someone found a way to fix that?

 

EDIT:

Ok found the bug rather quickly:

change `EGGWD` in your includes.sh

For Alfred 4: 

EGGWD="$HOME/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/carlosnz.eggtimer2"

 

In order to make "timer recent" work in Alfred 4 I also had to change "Alfred 2" in process_list.sh to "Alfred".

Link to comment
  • 3 weeks later...
  • 7 months later...
On 5/25/2016 at 12:58 AM, djan92 said:

Okay I think I figured it out.

 

In file, notify_functions.sh in the scripts folder of the EggTimer workflow, the $notification variable isn't set. I think this is because the plist info.plist file doesn't carry over to Alfred 3 perfectly.

 

I just hard coded 

notification=NC

at the top of the file, just below function definition.

 

Here's my whole notify_functions.sh file:

 

notify () {


notification=NC


#What is the chosen notification method?
prefs=$(cat info.plist | tr -d '\n\t') #Load workflow's settings info
if [[ "$prefs" = *'<key>output</key><integer>0</integer>'* ]]; then
notification=default
fi
if [[ "$prefs" = *'<key>output</key><integer>1</integer>'* ]]; then
notification=NC
fi
if [[ "$prefs" = *'<key>output</key><integer>2</integer>'* ]]; then
notification=growl
fi


if [ $notification = default ]; then
notpref=$(cat ../../preferences/notifications/prefs.plist | tr -d '\n\t')
if [[ "$notpref" = *'<key>defaultoutput</key><integer>1</integer>'* ]]; then
notification=growl
else
notification=NC
fi
fi


if [ "$5" = alarm ]; then
growl_icon="$PWD/resources/icon_alarm.png"
nc_icon="$PWD/resources/icon_alarm.icns"
dummy_app="EggTimer Alarm"
else
growl_icon="$PWD/icon.png"
nc_icon="$PWD/resources/icon.icns"
dummy_app="EggTimer"
fi


if [ $notification = growl ]; then
osascript <<EOD
set imgfd to open for access POSIX file "$growl_icon"
set img to read imgfd as "TIFF"
close access imgfd
tell application id "com.Growl.GrowlHelperApp"
notify with name "$1" title "$2" description "$3\n$4" application name "EggTimer for Alfred" sticky "true" image img
end tell
EOD
fi


if [ $notification = NC ]; then
./MountainNotifier/MountainNotifier "$dummy_app" "$2" "$3" "$4" "$nc_icon"
fi
}

Hope that helps!

 

I'm on Big Sur. Alfred 4. Everything was working well with 'Egg Timer 4 for Alfred 4' with the exception of not having a visible notification when the timer would go off. This comment is still relevant and was the solution. Now everything's working well.

Link to comment

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...