summaryrefslogtreecommitdiff
path: root/.doom.d/scripts/ics-to-org.sh
blob: 7cf8f6006614cb6862a11da95c7a5a0449f0877f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# This is a cron that runs every 15 mins and populates my emacs diary file with my calendar items

# Downloading calendar
echo "Downloading Calendar"
mkdir -p /tmp/calendar
cd /tmp/calendar
wget "https://cloud.rogs.me/remote.php/dav/public-calendars/kRMMJ2CArQeCPzRi/?export" -O "personal-calendar.ics" -c
wget "https://files-f1.motorsportcalendars.com/f1-calendar_qualifying_sprint_gp.ics" -O "f1.ics" -c

# Merge the calendars
cat f1.ics >> personal-calendar.ics

#Generating the file

echo "#Generating the file"
rm ~/.emacs.d/.local/cache/diary
emacs --batch -l ~/.doom.d/scripts/ics-to-org.el

echo "#Deleting everything"
#Deleting everything
rm -r /tmp/calendar