-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoogle-calendar
More file actions
executable file
·42 lines (41 loc) · 901 Bytes
/
google-calendar
File metadata and controls
executable file
·42 lines (41 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Written by tannhauser
# Commissioned by Zachary Vance
# Source: https://bountify.co/print-today-s-google-calendar
declare -a tasks=()
for i in "$@"
do
case "$i" in
--agenda)
tasks+=('agenda')
;;
--daily)
tasks+=("agenda '0am'")
;;
--four-days)
tasks+=("agenda '$(date +%D)' '$(date -d '4 days' +%D)'")
;;
--weekly)
tasks+=("calw")
;;
--monthly)
tasks+=("calm")
;;
--username=*)
USERNAME=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
;;
--password=*)
PASSWORD=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
;;
*)
echo 'unknown option'
;;
esac
done
for task in "${tasks[@]}"
do
gcalcli --nc --user=$USERNAME --pw=$PASSWORD $task > ~/.calendartmp &&
#cat ~/.calendartmp > /dev/lp
cat ~/.calendartmp
rm ~/.calendartmp
done