rewrite calcurse imports

This commit is contained in:
2026-04-20 21:32:02 +02:00
parent fb96f1bd78
commit e24b5ffb5d
2 changed files with 34 additions and 17 deletions

34
data/calcurse_import.sh Normal file
View File

@@ -0,0 +1,34 @@
---
title: Import an ICS file into calcurse
tags:
- data
- calendar
- daylight savings
requires:
- calcurse
---
## Setup
The UK government keeps an `ics` file with clock.
```sh
wget https://www.gov.uk/when-do-the-clocks-change/united-kingdom.ics
calcurse -i united-kingdom.ics
```
If you already have some of these events, and don't want duplicates, import the events into a temporary file.
```sh
TMP=$(mktemp)
curl -s "$1" | calcurse -q -i - -c "$TMP"
```
Then search for new lines in the new calendar file to put into your appointments file.
```sh
CALDATA=~/.local/share/calcurse/apts
grep -vf "$CALDATA" "$TMP" >> "$CALDATA"
rm $TMP
```