add new sync script

This commit is contained in:
stupidcomputer 2024-04-15 21:47:15 -05:00
parent 275fa01164
commit f2d4c7c364
2 changed files with 14 additions and 0 deletions

3
builds/utils/sh/is_school Executable file
View File

@ -0,0 +1,3 @@
cssid=$(nmcli -t -f IN-USE,SSID device wifi list | grep '^\*' | awk -F':' '{print $2}')
[ "WCS-BYOT" = "$cssid" ]

11
builds/utils/sh/sync Executable file
View File

@ -0,0 +1,11 @@
is_school && echo "enable the vpn"
mbsync --config=$HOME/.config/isync/config main
vdirsyncer sync
rbw sync
# check if we have new mail, and if so, notify
new=$(ls ~/Mail/main/INBOX/new | wc -l)
if [ "$new" -gt 0 ]; then
inbox=$(ls ~/Mail/main/INBOX/cur | wc -l)
printf "%i new email(s); %i total in inbox" "$new" "$inbox" > ~/.cache/statusbar_notification
fi