-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b314902
commit f78f109
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# iTerm Command | ||
|
||
Run any command via iTerm when joining a specific room. | ||
|
||
Arguments of the script: | ||
|
||
- `ROOM_NAME` - stringified name | ||
- `COMMAND` - what you want executed in the iTerm window |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"name": "iTerm Command", | ||
"description": "Run any command via iTerm when joining a room.", | ||
"platforms": ["macos"], | ||
"language": "bash" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
COMMAND="echo 'Replace me'" | ||
ROOM_NAME="Standup" | ||
|
||
if [ -z "$TUPLE_HOOK_IS_SELF" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ "$ROOM_NAME" != "$TUPLE_TRIGGER_ROOM_NAME" ]; then | ||
exit 0 | ||
fi | ||
|
||
|
||
osascript <<END | ||
tell application "iTerm" | ||
activate | ||
if (count of windows) = 0 then | ||
set newWindow to (create window with default profile) | ||
else | ||
set newWindow to current window | ||
end if | ||
tell newWindow | ||
set newTab to (create tab with default profile) | ||
tell newTab | ||
tell current session | ||
write text "${COMMAND}" | ||
end tell | ||
end tell | ||
end tell | ||
end tell | ||
END |