Skip to content

Google account

Settings › Accounts signs the shell in to Google accounts, which any part of the shell can then use. Add as many as you like, such as a work and a personal one. Everything reads all of them. Two parts do today: the Calendar tab shows the accounts’ events, and the todo board can hold today’s meetings.

The accounts themselves are not in this file. The grants Google hands back are stored in ~/.local/state/moonswing/google-account.json (mode 0600, in a 0700 directory). config.toml is the file people paste into bug reports, and a refresh token is a standing grant to read your calendar. Sign-in asks for calendar.readonly and nothing else.

There is nothing to set up. Open Settings › Accounts and press Sign in with Google. The shell opens Google’s consent page in your browser, running as Moonswing’s own Google app. It listens on 127.0.0.1 on a random port for Google to send the browser back, and protects the exchange with PKCE.

  • Google will say the app is unverified. Moonswing’s Google app has not been through Google’s verification yet. To continue, choose Advanced, then Go to Moonswing (unsafe). The consent screen then lists the one permission asked for: to see your calendars.
  • Until the app is verified, Google limits it to 100 users. If sign-in fails with a message about the app’s user cap, that limit has been reached.
  • Your calendar goes straight from Google to your computer. The project runs no server, so nothing passes through or is stored anywhere but your own machine. See the privacy policy.
  • Add account signs in another account. Google shows its account chooser so you can pick a different one. Signing in again as an account that is already there replaces its sign-in rather than listing it twice.
  • Sign out revokes that account’s grant at Google and deletes it from disk. The other accounts stay signed in. You can also revoke a grant from your Google account’s third-party connections.
  • Calendar settings takes you to Settings › Shell › Calendar, where the rest of this section is set: which of each account’s calendars are read, and what they are used for.

Earlier builds had you create your own OAuth client. A sign-in made that way cannot carry over. The Accounts page says so once, forgets it, and Sign in with Google reconnects you.

Key Type Default Description
calendars array of strings ["primary"] Calendar ids to read. primary is every signed-in account’s main calendar. Settings › Shell › Calendar lists each signed-in account’s calendars under its own heading, with a switch each.
show_in_calendar bool true Draw the accounts’ events on the Calendar tab, and offer its Week and Day views.
todo_sync bool false Put each of today’s timed events on the todo board as a card (see below).
refresh_minutes int 5 How often events are read again while something is showing them (1–60). Nothing is fetched while nothing shows them.

With todo_sync on, each timed event today gets a card holding its time, its join link (Meet, a conference link, or a URL in the location) and a link to the event. The card moves on its own: Todo until the meeting starts, In Progress while it runs, Finished once it ends. Each move is recorded at the meeting’s own start and end time, even when the shell catches up after a suspend.

  • A card you move is yours. After you drag a card to another column, the sync stops moving it. It still keeps the card’s time and link up to date.
  • An edit you make stays. The sync rewrites a card’s title or body only while it is still the text the sync wrote.
  • A deleted card stays deleted. The shell remembers the event and does not put it back.
  • A meeting that disappears from today’s calendar (cancelled, declined, or moved to another day) moves its card to Abandoned rather than deleting it.

All-day events stay in the Calendar tab and never become cards. A meeting you are invited to on two of your accounts makes one card, not two.

Calendar ids are unique across Google accounts (a main calendar’s id is the account’s address), so one calendars list covers every account. Each id is read through the first account whose calendar list holds it, so a calendar shared with two of your accounts is read once. An id no account lists, such as a public calendar you typed in by hand, is read through the first account.

Switching one account’s main calendar off in Settings › Shell › Calendar while primary is on writes the other accounts’ addresses in its place. Switching it back on folds them into primary again.

[google]
calendars = ["primary", "team@group.calendar.google.com"]
show_in_calendar = true
todo_sync = true
refresh_minutes = 5