-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathca
50 lines (41 loc) · 1.26 KB
/
ca
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
43
44
45
46
47
48
#!/bin/bash
#
#author: Dmytro Shytyi
#email: [email protected]
#website: https://shytyi.net
#website: https://dmytro.shytyi.net
#license: BSD
#Please feel free to use and modify this, but keep the above information. Thanks!
# The purpose of this script is to simplify the adding new events to google calendar
# when one have just one important calendar and you do not want to path useless parameters
# if you rename this script with name "ca" and will add to PATH the path to folder where it is located,
# the command to add quick event into google calendar from cli looks like this:
# $ca q 9:35 meeting with friends
# OR
# $ca a
# this will ask more details about event that is specified by "add" option in gcalcli
# specify your default calendar that you use usually
# the name of calendar is displayed in the https://calendar.google.co
# in the section "Calendars->Mouse right click->
# ->Calendar settings->Calendar Name"
cldrName='myAgenda'
state=0
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
q)
action='quick --calendar cldrName'
data="${@:2}"
gcalcli $action "$data"
state=1
;;
a)
if [ "$state" == 0 ];then
action='--calendar cldrName add'
gcalcli $action
fi
;;
esac
shift # past argument or value
done