Skip to content

Commit

Permalink
Add Gmail tab closing, hide discord, slack and notes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevysmith committed Nov 3, 2023
1 parent 12643fa commit e509cad
Show file tree
Hide file tree
Showing 20 changed files with 113 additions and 0 deletions.
7 changes: 7 additions & 0 deletions triggers/close-gmail-tabs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Close Gmail Tabs on Chrome

This trigger will hide Gmail tabs on Chrome automatically when you share your display.

This can be handy to save you from sharing private emails.

If you're executing this trigger for the first time, `System Events` may prompt you for permission.
Binary file added triggers/close-gmail-tabs/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions triggers/close-gmail-tabs/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Close Gmail tabs on Chrome",
"description": "Automatically close Gmail tabs when sharing your screen.",
"platforms": ["macos"],
"language": "applescript"
}
19 changes: 19 additions & 0 deletions triggers/close-gmail-tabs/screen-share-started
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript -l JavaScript <<'END'
var chrome = Application('Google Chrome');
if (chrome.running()) {
var windows = chrome.windows();
for (var i = 0; i < windows.length; i++) {
var tabs = windows[i].tabs();
for (var j = tabs.length - 1; j >= 0; j--) {
var tab = tabs[j];
if (tab.url().includes("mail.google.com")) {
tab.close();
}
}
}
}
END
fi
7 changes: 7 additions & 0 deletions triggers/hide-discord/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hide Discord

This trigger will hide the Discord.app automatically when you share your display.

This can be handy to save you from showing private conversations.

If you're executing this trigger for the first time, `System Events` may prompt you for permission.
Binary file added triggers/hide-discord/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions triggers/hide-discord/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Hide Discord.app",
"description": "Automatically hide Discord.app when sharing your screen.",
"platforms": ["macos"],
"language": "applescript"
}
7 changes: 7 additions & 0 deletions triggers/hide-discord/screen-share-started
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript <<END
tell application "System Events" to set visible of application process "Discord" to false
END
fi
7 changes: 7 additions & 0 deletions triggers/hide-discord/screen-share-stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript <<END
tell application "System Events" to set visible of application process "Discord" to true
END
fi
7 changes: 7 additions & 0 deletions triggers/hide-notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hide Notes

This trigger will hide the Notes.app automatically when you share your display.

This can be handy to save you from showing your private notes.

If you're executing this trigger for the first time, `System Events` may prompt you for permission.
Binary file added triggers/hide-notes/assets/.DS_Store
Binary file not shown.
Binary file added triggers/hide-notes/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions triggers/hide-notes/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Hide Notes.app",
"description": "Automatically hide Notes.app when sharing your screen.",
"platforms": ["macos"],
"language": "applescript"
}
7 changes: 7 additions & 0 deletions triggers/hide-notes/screen-share-started
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript <<END
tell application "System Events" to set visible of application process "Notes" to false
END
fi
7 changes: 7 additions & 0 deletions triggers/hide-notes/screen-share-stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript <<END
tell application "System Events" to set visible of application process "Notes" to true
END
fi
7 changes: 7 additions & 0 deletions triggers/hide-slack/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hide Slack

This trigger will hide the Slack.app automatically when you share your display.

This can be handy to save you from showing private conversations.

If you're executing this trigger for the first time, `System Events` may prompt you for permission.
Binary file added triggers/hide-slack/assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions triggers/hide-slack/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Hide Slack.app",
"description": "Automatically hide Slack.app when sharing your screen.",
"platforms": ["macos"],
"language": "applescript"
}
7 changes: 7 additions & 0 deletions triggers/hide-slack/screen-share-started
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript <<END
tell application "System Events" to set visible of application process "Slack" to false
END
fi
7 changes: 7 additions & 0 deletions triggers/hide-slack/screen-share-stop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ -n "$TUPLE_TRIGGER_IS_SELF" ]; then
osascript <<END
tell application "System Events" to set visible of application process "Slack" to true
END
fi

0 comments on commit e509cad

Please sign in to comment.