Initial import of the calcurse Google Calendar sync from the dotfiles
Scripts, user units and hooks moved to system paths, the xmobar script as calcurse-xmobar with colour options, and expiry detection that also catches the first invalid_grant failure.
This commit is contained in:
17 files changed
+1077
No files matched your search
@@ -0,0 +1,68 @@
|
||||
# calcurse-gcal
|
||||
|
||||
Keeps [calcurse](https://calcurse.org) in sync with Google Calendar through `calcurse-caldav`, and handles what
|
||||
`calcurse-caldav` leaves to you:
|
||||
|
||||
- `calcurse-sync`: hourly sync from a systemd user timer. It skips the sync while the calcurse UI is open (the UI keeps
|
||||
the data in memory and would overwrite what was synced), and restarts the calcurse daemon after an import so new
|
||||
appointments get alerts.
|
||||
- UI hooks: sync before the UI loads, and again after it exits when it saved changes.
|
||||
- `calcurse-relogin`: when Google's login expires, a notification asks to log in again; clicking it opens the consent
|
||||
page and catches the redirect on `127.0.0.1`, so there is no code to copy and paste.
|
||||
- `calcurse-today`: a morning notification for today's whole-day events (the daemon only alerts timed appointments).
|
||||
- `calcurse-xmobar`: the next appointment for xmobar, and today's and tomorrow's items in a notification.
|
||||
|
||||
## Requirements
|
||||
|
||||
- A Google Cloud OAuth client (type "Desktop app") with the Calendar API enabled, and its client ID and secret.
|
||||
- A notification daemon (`notify-send`, with actions support for the login prompt).
|
||||
|
||||
## Installation
|
||||
|
||||
Build and install the package with the included PKGBUILD, which builds the signed release tag set in `pkgver`:
|
||||
|
||||
```
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
Or, with aurutils, build it into a local repository with `aur build` and install it with pacman.
|
||||
|
||||
Then:
|
||||
|
||||
1. Copy `/usr/share/doc/calcurse-gcal/config.example` to `~/.config/calcurse/caldav/config` (mode 600) and fill in
|
||||
your address and OAuth client.
|
||||
2. Log in once: `calcurse-relogin`, then click Allow in the browser.
|
||||
3. Link the hooks (if you have your own, call these from them instead):
|
||||
|
||||
```
|
||||
mkdir -p ~/.config/calcurse/hooks
|
||||
ln -s /usr/share/calcurse-gcal/hooks/{pre-load,post-save} ~/.config/calcurse/hooks/
|
||||
```
|
||||
|
||||
4. Start the timers from your window manager's startup, along with the daemon (the units have no `[Install]`, so
|
||||
they don't run under other sessions):
|
||||
|
||||
```
|
||||
calcurse --daemon
|
||||
systemctl --user start calcurse-sync.timer calcurse-today.timer
|
||||
```
|
||||
|
||||
5. Optional, for desktop notifications of appointments, in `~/.config/calcurse/conf`:
|
||||
|
||||
```
|
||||
notification.command=calcurse --next | xargs -0 notify-send -a calcurse -i x-office-calendar "Appointment"
|
||||
```
|
||||
|
||||
### xmobar
|
||||
|
||||
```haskell
|
||||
, Run Com "calcurse-xmobar" [] "calcurse" 600
|
||||
```
|
||||
|
||||
and `<action=`calcurse-xmobar list`>%calcurse%</action>` in the template. `--apt-color`, `--event-color`, `--icon`
|
||||
and `--suffix` change the defaults (Dracula pink and cyan, a Nerd Font calendar icon, `" | "`).
|
||||
|
||||
## Login expiry
|
||||
|
||||
With the OAuth client's consent screen in "Testing" status, Google expires the login after 7 days; in "In
|
||||
production" (no verification needed for your own account) it lasts until revoked or unused for 6 months.
|
||||
Reference in new issue
Block a user