Last active
May 6, 2022 02:45
-
-
Save SeanMcTex/bcb78d005da92fa5fbcab1e4a9e1fd57 to your computer and use it in GitHub Desktop.
Script to turn on/off light for videoconferencing automatically. Requires a Mac, Oversight, and Shortcuts app.
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
#!/bin/bash | |
# To use this script: | |
# 1. Save it on your Mac hard drive somewhere convenient. | |
# 2. `chmod` its permissions to make it executable. E.g. `chmod 755 handle-camera.sh`. | |
# 3. In the Shortcuts app, create "Start Conference" and "End Conference" shortcuts that activate lights | |
# and do whatever else you want to happen when conferences start and end. | |
# 4. Download and install Oversight to watch for camera activation/deactivation: | |
# https://objective-see.com/products/oversight.html | |
# 5. Configure Oversight's "action" panel to run this script. Turn on the option that passes arguments. | |
# I realize this is hacky. Smart parameter parsing is left as an exercise for the reader. :) | |
device=$2 | |
event=$4 | |
case $device in (*"camera"*) | |
case $event in (*"on"*) | |
shortcuts run 'Start Conference' | |
;;esac | |
case $event in (*"off"*) | |
shortcuts run 'End Conference' | |
;;esac | |
;;esac | |
# This was inspired by Edward Anderson's article; thanks, Edward! | |
# https://technology.doximity.com/articles/light-up-your-wfh-meetings-with-homekit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment