From f2d4c7c3649e90d660a1623ed6f629af4d28e8f5 Mon Sep 17 00:00:00 2001 From: stupidcomputer Date: Mon, 15 Apr 2024 21:47:15 -0500 Subject: [PATCH] add new sync script --- builds/utils/sh/is_school | 3 +++ builds/utils/sh/sync | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100755 builds/utils/sh/is_school create mode 100755 builds/utils/sh/sync diff --git a/builds/utils/sh/is_school b/builds/utils/sh/is_school new file mode 100755 index 0000000..3c11bf8 --- /dev/null +++ b/builds/utils/sh/is_school @@ -0,0 +1,3 @@ +cssid=$(nmcli -t -f IN-USE,SSID device wifi list | grep '^\*' | awk -F':' '{print $2}') + +[ "WCS-BYOT" = "$cssid" ] diff --git a/builds/utils/sh/sync b/builds/utils/sh/sync new file mode 100755 index 0000000..4bc8b6c --- /dev/null +++ b/builds/utils/sh/sync @@ -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