Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added commands/apps/tomighty/images/tomighty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions commands/apps/tomighty/tomighty-start-pomodoro.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/osascript

# Install Tomighty via https://tomighty.org/mac/
# or from Github Releases: https://github.com/tomighty/tomighty-osx/releases

# @raycast.title Start Pomodoro
# @raycast.author Marc Ignacio
# @raycast.authorURL https://github.com/padi
# @raycast.description Start Pomodoro via Tomighty's default hotkey

# @raycast.icon images/tomighty.png
# @raycast.mode silent
# @raycast.packageName Tomighty
# @raycast.schemaVersion 1

# Start Tomighty automatically, bring it to the foreground
tell application "Tomighty" to activate

tell application "System Events"
# Wait for activity...
repeat until exists process "Tomighty"
delay 0.2
end repeat

# Press the defaut hotkey for "Start Pomodoro"
keystroke "p" using {control down, command down}
log "Started Pomodoro"
end tell
31 changes: 31 additions & 0 deletions commands/apps/tomighty/tomighty-stop-pomodoro.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/osascript

# Install Tomighty via https://tomighty.org/mac/
# or from Github Releases: https://github.com/tomighty/tomighty-osx/releases

# @raycast.title Stop Pomodoro
# @raycast.author Marc Ignacio
# @raycast.authorURL https://github.com/padi
# @raycast.description Stop Pomodoro via Tomighty's default hotkey

# @raycast.icon images/tomighty.png
# @raycast.mode silent
# @raycast.packageName Tomighty
# @raycast.schemaVersion 1

# tomightyIsRunning should have a PID if running or "" if not running
set tomightyIsRunning to (do shell script "pgrep Tomighty || true")

if tomightyIsRunning is not "" then
tell application "System Events"
# Press the defaut hotkey for "Stop Pomodoro"
keystroke "s" using {control down, command down}
end tell

log "Stopped Pomodoro"
else
log "Tomighty is not running. Start a pomodoro first"
# Play subtle Basso sound
# afplay is a built-in, native command-line utility in macOS
do shell script "afplay /System/Library/Sounds/Basso.aiff"
end if