Skip to content

Instantly share code, notes, and snippets.

@lexicalunit
Created February 23, 2021 21:47
Show Gist options
  • Save lexicalunit/ff7bb0981cb92ee5ce1cac6f83e1c248 to your computer and use it in GitHub Desktop.
Save lexicalunit/ff7bb0981cb92ee5ce1cac6f83e1c248 to your computer and use it in GitHub Desktop.
Runs forever and detects when you're in a meeting, updating BlinkStick as needed.
#!/bin/bash
source "$HOME/.blickstick_utilities"
APP="zoom.us"
OP="osascript -e 'tell application \"System Events\" to (name of processes) contains \"$APP\"'"
FIREFOX_TABS="firefox-tabs"
is_running() {
TABS="$($FIREFOX_TABS | grep 'meet.google.com')"
test "$(eval "$OP")" = "true" || test -n "$TABS"
}
while true; do
if ! blink_is_busy; then
if is_running; then
if ! blink_is_red; then
blink_set_color red
fi
else
if ! blink_is_green; then
blink_set_color green
fi
fi
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment