- JavaScript 100%
|
|
||
|---|---|---|
| .claude/skills/changelog | ||
| .forgejo/workflows | ||
| .zed | ||
| build | ||
| .gitignore | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| main.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Fastmail Tray
A minimal Electron wrapper around app.fastmail.com that does the two things the
official Fastmail desktop app doesn't: stays resident in the system tray and
closes to the tray instead of quitting. Desktop notifications for new mail come
straight from Fastmail's own web client (JMAP push → HTML5 Notification API, which
Electron bridges to native OS notifications) — this wrapper just keeps the window
alive so they keep arriving.
Prerequisites
- Node.js 18+ and npm
- A desktop environment that hosts a system tray (see the GNOME note below)
First-time setup
cd fastmail-tray
npm install
Run (development)
npm start
Log in once; the session persists in Electron's userData dir, so you stay logged in.
Enable notifications inside Fastmail: Settings → Notifications → turn on new-mail notifications, and accept the browser permission prompt the first time. Without this, Fastmail never fires notifications and the wrapper has nothing to relay.
Build a standalone AppImage
npm run dist
The AppImage lands in dist/. Make it executable and run it:
chmod +x dist/Fastmail-*.AppImage
./dist/Fastmail-*.AppImage
Your own icon
Replace build/icon.png (the included one is a placeholder). Use 512×512 PNG;
electron-builder generates the other sizes. The same file is used for the window and
the tray. If the tray icon looks fuzzy, supply a separate small, simple/monochrome
image and point the Tray at it in main.js.
Wayland notes
main.jssets--ozone-platform-hint=autobefore app-ready, so the packaged AppImage picks Wayland or X11 automatically. Thenpm startscript passes the same flag for dev runs.- The tray icon uses StatusNotifierItem over DBus (display-server-agnostic), but
your DE must host a tray:
- KDE Plasma — works natively.
- GNOME — install the AppIndicator and KStatusNotifierItem Support extension, or the tray icon won't appear at all.
- Heads-up: tray-click hide/show can be flaky on some Wayland compositors (window
restoring on the wrong workspace, or not regaining focus). It's reliable on KDE
Plasma. Test on your compositor early. If
tray.on('click')misbehaves, drop it and use the right-click context menu's "Open Fastmail" instead.
Optional extras
- Unread badge: already wired —
main.jsparses the unread count out of the page title and callsapp.setBadgeCount(). This shows up on launchers that support libunity badging; behavior varies by DE. - Start on login: add a
.desktopfile in~/.config/autostart/pointing at the AppImage, or callapp.setLoginItemSettings({ openAtLogin: true })ininit(). mailto:handler: uncommentapp.setAsDefaultProtocolClient('mailto')ininit()to register. Note that on its own this just opens the inbox when you click an email link — deep-linking into Fastmail's compose view requires handling themailto:argv in thesecond-instanceevent and navigating to Fastmail's compose URL, whose exact format you'll want to confirm from the running web app first.
License
MIT