Skip to content

Commit f334916

Browse files
Merge pull request #1023 from padi/tomighty
feat: tomighty
2 parents a1b5f90 + 2ca0fa4 commit f334916

3 files changed

Lines changed: 59 additions & 0 deletions

File tree

3.33 KB
Loading
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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

0 commit comments

Comments
 (0)