Per-app profiles
Automatically swap button bindings based on the frontmost app by authoring per-app overlays in config.toml.
Per-app profiles let OpenLogi swap a device's button bindings automatically
based on the frontmost app. A background watcher reads the foreground app's
identifier (on macOS, the bundle id — e.g. com.microsoft.VSCode) once per
second; when it changes, the overlay you authored for that app is layered on
top of the device's global bindings, with per-app
entries winning and any unlisted button falling through to the global map. The scope is strictly
button bindings — gestures, DPI presets, and lighting stay device-wide and do
not switch per app.
From the GUI
There is no per-app editor in the GUI yet. The action picker only edits the
device's global bindings; overlays are hand-authored in
config.toml. Two things are surfaced:
- Active profile — a read-only row on the configuration card showing the frontmost app's bundle id as the active profile, or a Default profile label when no app is frontmost. It is a status display, not an editor.
- Auto-switch — fully automatic, with no control. When the watcher reports a new bundle id, OpenLogi rebuilds the in-memory binding map and hands it to the event hook, so a button press picks up the new app's overlay immediately, regardless of which window has focus.
Authoring overlays
Add a table under [devices.<key>.per_app_bindings."<bundle-id>"] keyed by the
exact bundle id, holding a partial button → action map. Buttons you list
override the global binding while that app is frontmost; buttons you omit keep
their global value.
[devices.2b042.bindings]
Back = "BrowserBack"
Forward = "BrowserForward"
# While VS Code is frontmost, Back becomes Undo and Forward becomes Redo.
[devices.2b042.per_app_bindings."com.microsoft.VSCode"]
Back = "Undo"
Forward = "Redo"Values are action names written verbatim. The
overlay only adds or overrides keys — it never removes one, so to make a button
do nothing in a given app set it to None rather than omitting it.
Matching is by exact bundle id — there is no wildcard or pattern matching, so
the frontmost bundle id must equal a per_app_bindings key character for
character. Switching is also polled at roughly 1 second, so expect up to a
second of latency after you change apps.
On macOS the app key is the bundle id (com.microsoft.VSCode). On Linux it is
the X11 WM_CLASS class name of the active window, so overlays work on X11 —
and on Wayland only through XWayland windows; native Wayland surfaces report no
class and fall back to the Default profile. On Windows the foreground
watcher is not wired up yet. And as with all remapping today, the OS hook owns
the side Back / Forward buttons; middle, mode-shift, and thumbwheel capture
are configurable, but hardware capture is still in progress, and gesture-button
per-direction bindings are landing (see the roadmap).
Status: macOS shipping; Linux shipping on X11 (Wayland via XWayland only).
Authored in config.toml; driven by the OS
foreground-app API, not a HID++ feature.