ihowson / eggtimer2 Goto Github PK
View Code? Open in Web Editor NEWA fork of CarlosNZ's EggTimer 2 Alfred Workflow. Updated to work with Alfred 3.
A fork of CarlosNZ's EggTimer 2 Alfred Workflow. Updated to work with Alfred 3.
Not sure if there is an easier way to enable Notification center or growl but I had to edit the plist and required some hunting around to find the parameter. Maybe a note somewhere explaining which parameter to change and what the values mean (0: no notification, 1: notification center, 2: growl).
Hello,
Just downloaded the latest repo and installed it (by moving it into the workflows folder). The current timers are not being listed correctly. Also, for one timer I got the notification that it expired, for another I did not.
I haven't tried this fork (I don't think), but the MN app thing isn't working anymore for async notifications. I made some changes to the notify_functions.sh
script to make this a little easier (I tried to stick with sh
rather than bash
constructs, since I couldn't tell what interpreter/version would eventually run it; i.e., I didn't use arrays where I would have liked to.).
If you prefer a notification, uncomment the first display
line and comment out the second one.
The notification unfortunately opens the script editor if you click it, so I found the dialog a better feel.
_growl() {
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
}
_nc() {
# ./MountainNotifier/MountainNotifier "$dummy_app" "$2" "$3" "$4" "$nc_icon"
osascript <<EOF
# display notification "$4" with title "$2" subtitle "$3"
display alert "$2" message "$3" & return & "$4" as informational
EOF
}
notify () {
#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
_growl "$@" &
elif [ $notification = NC ]; then
_nc "$@" &
fi
}
I have not been able to use "recent timers", a feature previously enabled on the older version of the workflow. I know there's a related ticket re: current timers not being listed, #6.
Symbol links required:
``
cd '~/Library/Application Support'
ln -s 'Alfred 3' 'Alfred 2'
cd ~/Library/Caches/
ln -s com.runningwithcrayons.Alfred-3 com.runningwithcrayons.Alfred-2
mkdir -p com.runningwithcrayons.Alfred-3/Workflow Data/carlosnz.eggtimer2
cd com.runningwithcrayons.Alfred-3/Workflow Data/carlosnz.eggtimer2
mkdir running_timers running_autotimers running_alarms recent_timers
``
Because Egg Timer is looking for Alfred 2 folder, which does not exist..
Otherwise you will be prompt to launch EggTimer at login again and again.
Thanks for having updated the scripts, I appreciate you published it!
Hi there, I'm on Alfred 4 and I triedd installing eggtimer, but any time I try to do something with it, a popup shows up asking whether I want to resume my timers after restart. Whatever I choose, the popup shows up again anytime I try to use eggtimer, and the timer doesn't start.
Perhaps I'm missing something very obvious but I dont know how to take this repo and import it into Alfred. I tried compressing it and renaming the extension to .alfredworkflow
๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.