Created
February 23, 2021 21:47
-
-
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.
This file contains hidden or 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 | |
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