Topic: https://brettterpstra.com/2012/04/15/desktop-countdown-timer-with-geektool-and-applescript/
hide preview ▲show preview ▼

What's next? verify your email address for reply notifications!

Sam Fearn 13y, 185d ago

I wanted to use this with alfred, so I thought I'd post the alfred action in cae anyone wants to use it without having to go through the code to see what needs changing, though as Brett said, it's a very simple change. Set the "command" field of an alfred applescript action to:
''# if a timer is running, kill it
pid=$(ps ax | grep -E "osascript .*/geektooltimer" | grep -v grep | awk '{print $1}')
[[ $pid ]] && kill $pid

Clear any existing text

/usr/bin/osascript -e 'tell application "GeekTool Helper" to set command of shell geeklet named "GeekTimer" to "echo"' 
/usr/bin/osascript ~/Documents/Geektool/GeekTimer/geektooltimer.applescript {query} 2>&1 &''

I also changed the line of the appescript
' do shell script "/usr/bin/afplay /System/Library/Sounds/Glass.aiff"'
to
' do shell script "/usr/bin/afplay -v 10/System/Library/Sounds/Glass.aiff"'
to make it slightly more audible over any other sounds that might be playing and added the line:
'say "Time to " & _task'
mainly because using the say command is fun :)

Now just to combine this with your post about imagemagick to make it look a little nicer on my desktop...

remark link
hide preview ▲show preview ▼

What's next? verify your email address for reply notifications!

Sam Fearn 13y, 185d ago

Ah bother, that doesn't seem to have posted very nicely at all, the alfred command field should be:

# if a timer is running, kill it
pid=$(ps ax | grep -E "osascript .*/geektooltimer" | grep -v grep | awk '{print $1}')
[[ $pid ]] && kill $pid
# Clear any existing text
/usr/bin/osascript -e 'tell application "GeekTool Helper" to set command of shell geeklet named "GeekTimer" to "echo"'
/usr/bin/osascript ~/Documents/Geektool/GeekTimer/geektooltimer.applescript {query} 2>&1 &
hide preview ▲show preview ▼

What's next? verify your email address for reply notifications!

Steph 13y, 270d ago

Just what I was wishing for! This will work great with pomodoros

hide preview ▲show preview ▼

What's next? verify your email address for reply notifications!