File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Install Tomighty via https://tomighty.org/mac/
4+ # or from Github Releases: https://github.com/tomighty/tomighty-osx/releases
5+
6+ # @raycast.title Start Pomodoro
7+ # @raycast.author Marc Ignacio
8+ # @raycast.authorURL https://github.com/padi
9+ # @raycast.description Start Pomodoro via Tomighty's default hotkey
10+
11+ # @raycast.icon images/tomighty.png
12+ # @raycast.mode silent
13+ # @raycast.packageName Tomighty
14+ # @raycast.schemaVersion 1
15+
16+ # Start Tomighty automatically, bring it to the foreground
17+ tell application " Tomighty" to activate
18+
19+ tell application " System Events"
20+ # Wait for activity...
21+ repeat until exists process " Tomighty"
22+ delay 0.2
23+ end repeat
24+
25+ # Press the defaut hotkey for "Start Pomodoro"
26+ keystroke " p" using {control down, command down}
27+ log " Started Pomodoro"
28+ end tell
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+
3+ # Install Tomighty via https://tomighty.org/mac/
4+ # or from Github Releases: https://github.com/tomighty/tomighty-osx/releases
5+
6+ # @raycast.title Stop Pomodoro
7+ # @raycast.author Marc Ignacio
8+ # @raycast.authorURL https://github.com/padi
9+ # @raycast.description Stop Pomodoro via Tomighty's default hotkey
10+
11+ # @raycast.icon images/tomighty.png
12+ # @raycast.mode silent
13+ # @raycast.packageName Tomighty
14+ # @raycast.schemaVersion 1
15+
16+ # tomightyIsRunning should have a PID if running or "" if not running
17+ set tomightyIsRunning to (do shell script " pgrep Tomighty || true" )
18+
19+ if tomightyIsRunning is not "" then
20+ tell application " System Events"
21+ # Press the defaut hotkey for "Stop Pomodoro"
22+ keystroke " s" using {control down, command down}
23+ end tell
24+
25+ log " Stopped Pomodoro"
26+ else
27+ log " Tomighty is not running. Start a pomodoro first"
28+ # Play subtle Basso sound
29+ # afplay is a built-in, native command-line utility in macOS
30+ do shell script " afplay /System/Library/Sounds/Basso.aiff"
31+ end if
You can’t perform that action at this time.
0 commit comments