/electron-overlay-dimming
Reusable pattern for focus-based auto-dimming of Electron overlay windows — when the app loses focus, all overlay windows fade to a low opacity; when an overlay regains focus, they return to their configured opacity. Use when building always-on-top Electron overlays that should
$ npx -y skills add sonichi/sutando --skill electron-overlay-dimming --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/electron-overlay-dimming
Context preview
The summary Claude sees to decide when to auto-load this skill.
Reusable pattern for focus-based auto-dimming of Electron overlay windows — when the app loses focus, all overlay windows fade to a low opacity; when an overlay regains focus, they return to their configured opacity. Use when building always-on-top Electron overlays that should
SKILL.md
electron-overlay-dimming.SKILL.mdname: electron-overlay-dimming
description: Reusable pattern for focus-based auto-dimming of Electron overlay windows — when the app loses focus, all overlay windows fade to a low opacity; when an overlay regains focus, they return to their configured opacity. Use when building always-on-top Electron overlays that should recede while the user works in other apps.
Electron Overlay Auto-Dimming
A small, self-contained pattern for always-on-top Electron overlays: the overlays stay readable while in use but **fade out of the way** when the user clicks into another application, and **restore** when focus returns to an overlay. First shipped in the `benchmark-overlay` app.
Behaviour
- App loses focus (no overlay window is focused) → every overlay window's
opacity drops to a dim level (~0.2).
- Focus returns to any overlay → every overlay restores to its *configured*
opacity (not blindly to 1.0 — it respects any per-overlay opacity the user set).
Why it's not naive
Two pitfalls the pattern handles:
1. **Inter-overlay clicks.** Clicking from overlay A to overlay B fires a `blur` then a `focus`. Dimming on raw `blur` would flicker. The fix: on `blur`, defer ~80 ms and only dim if `BrowserWindow.getFocusedWindow()` is then `null` — i.e. the *app* truly lost focus, not just one window. 2. **Configured opacity.** Overlays may each have a user-set base opacity. Auto-dim must dim *from* and restore *to* that value, so opacity is always computed as `appDimmed ? DIM_OPACITY : overlay.config.opacity`.
Reference implementation (main process)
const DIM_OPACITY = 0.2;
let appDimmed = false;
function effectiveOpacity(o) {
return appDimmed ? DIM_OPACITY : o.config.opacity;
}
function applyOpacityAll() {
for (const o of Object.values(OVERLAYS)) {
if (o.win && !o.win.isDestroyed()) o.win.setOpacity(effectiveOpacity(o));
}
}
app.on('browser-window-focus', () => {
if (appDimmed) { appDimmed = false; applyOpacityAll(); }
});
app.on('browser-window-blur', () => {
// Defer so an A→B overlay click doesn't briefly dim.
setTimeout(() => {
if (!appDimmed && !BrowserWindow.getFocusedWindow()) {
appDimmed = true;
applyOpacityAll();
}
}, 80);
});Any code path that sets a window's opacity (e.g. a config handler) must route through `effectiveOpacity()` so opacity changes made while dimmed don't undim the window.
Reference app
Live implementation: `~/projects/benchmark-overlay/main.js` — the `benchmark-overlay` app applies this across three overlay windows (AI Benchmarks, System Resources, Hub Overlay).
Read more
name: electron-overlay-dimming description: Reusable pattern for focus-based auto-dimming of Electron overlay windows — when the app loses focus, all overlay windows fade to a low opacity; when an overlay regains focus, they return to their configured opacity. Use when building always-on-top Electron overlays that should recede while the user works in other apps.
Electron Overlay Auto-Dimming
A small, self-contained pattern for always-on-top Electron overlays: the overlays stay readable while in use but **fade out of the way** when the user clicks into another application, and **restore** when focus returns to an overlay. First shipped in the `benchmark-overlay` app.
Behaviour
- App loses focus (no overlay window is focused) → every overlay window's
opacity drops to a dim level (~0.2).
- Focus returns to any overlay → every overlay restores to its *configured*
opacity (not blindly to 1.0 — it respects any per-overlay opacity the user set).
Why it's not naive
Two pitfalls the pattern handles:
1. **Inter-overlay clicks.** Clicking from overlay A to overlay B fires a `blur` then a `focus`. Dimming on raw `blur` would flicker. The fix: on `blur`, defer ~80 ms and only dim if `BrowserWindow.getFocusedWindow()` is then `null` — i.e. the *app* truly lost focus, not just one window. 2. **Configured opacity.** Overlays may each have a user-set base opacity. Auto-dim must dim *from* and restore *to* that value, so opacity is always computed as `appDimmed ? DIM_OPACITY : overlay.config.opacity`.
Reference implementation (main process)
const DIM_OPACITY = 0.2;
let appDimmed = false;
function effectiveOpacity(o) {
return appDimmed ? DIM_OPACITY : o.config.opacity;
}
function applyOpacityAll() {
for (const o of Object.values(OVERLAYS)) {
if (o.win && !o.win.isDestroyed()) o.win.setOpacity(effectiveOpacity(o));
}
}
app.on('browser-window-focus', () => {
if (appDimmed) { appDimmed = false; applyOpacityAll(); }
});
app.on('browser-window-blur', () => {
// Defer so an A→B overlay click doesn't briefly dim.
setTimeout(() => {
if (!appDimmed && !BrowserWindow.getFocusedWindow()) {
appDimmed = true;
applyOpacityAll();
}
}, 80);
});Any code path that sets a window's opacity (e.g. a config handler) must route through `effectiveOpacity()` so opacity changes made while dimmed don't undim the window.
Reference app
Live implementation: `~/projects/benchmark-overlay/main.js` — the `benchmark-overlay` app applies this across three overlay windows (AI Benchmarks, System Resources, Hub Overlay).
My AI Stand — Realtime by Day, Rewriting Itself by Night. Summon my AI superpower. Voice, vision, screen, meetings, calls when I'm engaged. Learns my patterns, ships its own code when I'm not. Runs across my Macs, interacts with people & their Stands.
Repo: sonichi/sutando
Other skills on sutando.
- /agent-registry
Local Agent Registry — a standalone, dependency-free service that tracks running Claude Code (and other) agent instances. Agents self-register on startup and heartbeat while alive; the Electron overlay and Sutando dashboard read the live list. Use when you need to know which
Open skill - /agent-room-ops
**One skill, multiple tools.** Everything an agent does in a room beyond its task inbox lives here as a tool, so the parity capabilities are self-evidently *one collection* (not N scattered skills). Each tool is a thin **gateway-only** client verb sharing `_gateway.py`; the
Open skill - /audio-transcribe
Transcribes audio files and voice notes to text via Gemini 2.5-flash. Integrates with Slack, Discord, and Telegram bridges so voice clips surface as readable text in tasks.
Open skill - /bot2bot-post
Post a coordination message from this bot to the shared bot2bot channel — @-mentioning a specific peer via --to, auto-mentioning only in single-peer fleets, never guessing.
Open skill - /call-diagnostics
Analyze phone call observability data, detect problems, track them across calls, and recommend systematic repairs.
Open skill - /claude-codex
Bash wrapper around the local Codex CLI for non-interactive runs from inside Sutando (bridges, cron, scripts). For interactive code review or task hand-off from this Claude Code session, prefer the official `/codex:*` plugin commands; this skill is the file-bridge-compatible
Open skill

