Created
November 4, 2019 12:22
-
-
Save LeZuse/b00322acc06030848b134ef56c90bfbb to your computer and use it in GitHub Desktop.
BitBar plugin for listing today's meetings with a Zoom quick join option
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
#!/usr/local/bin/bash | |
# Prerequisites: | |
# mkdir gcalcli-local && cd !$ | |
# pip3 install virtualenv | |
# virtualenv venv | |
# source venv/bin/activate | |
# pip3 install gcalcli | |
# which gcalcli # use this as command path in this script below | |
# deactivate | |
# Setup | |
# Login gcalcli: https://github.com/insanum/gcalcli#login-information | |
# Change the calendar name in the script below | |
echo zoom | |
echo --- | |
export LC_ALL=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
today_zoom_meetings() { | |
#now 23:58:59 | |
/Users/zuse/Projects/gcalcli-local/venv/bin/gcalcli \ | |
--calendar '\@Work' agenda today 23:59:59 --tsv \ | |
--details location \ | |
--details description #| \ | |
# grep zoom | |
} | |
# echo "$DATA" | cut -d$'\t' -f2 #start time | |
# echo "$DATA" | cut -d$'\t' -f3 # end date | |
# echo "$DATA" | cut -d$'\t' -f4 # end time | |
# echo "$DATA" | cut -d$'\t' -f5 #name | |
# echo "$DATA" | cut -d$'\t' -f6 #desc | |
today_zoom_meetings | while read line ; do | |
time=`echo "$line" | cut -d$'\t' -f2` #start time | |
end=`echo "$line" | cut -d$'\t' -f4` #end time | |
name=`echo "$line" | cut -d$'\t' -f5` #name | |
loc=`echo "$line" | cut -d$'\t' -f6` #location | |
desc=`echo "$line" | cut -d$'\t' -f7` #desc | |
# TODO: treat newlines better here | |
zoom=` | |
echo "$desc" | \ | |
sed -e 's/.*\(http.*zoom.us\/j\/\([\/a-zA-Z0-9]\{0,\}\)\).*/href=\1/g' | |
` | |
# empty zoom var when there was no match | |
zoom=`echo "$desc" | grep zoom >/dev/null && echo "$zoom"` | |
# https://medium.com/zoom-developer-blog/zoom-url-schemes-748b95fd9205 | |
# TODO: zoommtg://zoom.us/join?confno=123456789 | |
# zoom=`echo "$zoom" | grep zoom >/dev/null && echo "zoommtg://zoom.us/join?confno=$zoom"` | |
echo "$time - $end $name" | |
[ -z "$zoom" ] || echo "--Join Zoom | $zoom" | |
[ -z "$loc" ] || echo "--$loc" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment