Margin v0.5.1
Reference

Per-app settings

On Windows, any edge or corner can do something else while a particular app is the window in front. For example, the bottom edge can seek in your video player, switch tabs in your browser, and switch virtual desktops everywhere else.

#Setting it up

  1. Open the settings window (left-click the tray icon).
  2. Next to Settings for, click Add an app… and pick the app's program, for example vlc.exe or chrome.exe.
  3. With that app chosen in the list, click an edge or corner on the map.
  4. Tick Different in vlc (the box is named after the app), then choose what that section does in this app.

Settings for vlc: the bottom edge is set to Seek and ticked Different in vlc; it and the bottom-right corner have orange outlines

Sections that are different for the chosen app have an orange outline on the map. Every other section follows the settings for All apps: while the box is unticked, the editor shows those settings greyed out. Untick the box to make a section follow all apps again. Remove deletes the app's settings.

The switches at the top (on/off, how a slide starts, speed, zone sizes) are shared by all apps.

#How Margin picks the settings

Margin watches which window is in front. When a slide or a corner press starts, it uses that app's settings, and a slide keeps them until you lift your finger, even if it switches to another app on the way (as Alt+Tab does). Margin's own settings window doesn't count as an app, so you can keep it open while trying things.

Apps are matched by program name, without the folder or .exe, and case doesn't matter: C:\Program Files\VideoLAN\VLC\vlc.exe is vlc. To see what Margin thinks is in front, run margin.exe --diag: it prints a line such as front app: vlc (its own settings) each time the window in front changes.

#In settings.json

Per-app settings are kept under apps. Each entry names the program and lists only the sections that are different; see Settings file.

json
"apps": [
  {
    "app": "vlc",
    "sections": {
      "bottom": { "slide": "seek" },
      "bottomLeft": { "clicks": [ { "do": "playPause" } ], "longPress": { "do": "mute" } }
    }
  }
]

#Linux

Linux keeps per-app settings in the file but doesn't use them yet, because Wayland has no common way to tell which app is in front. The settings for all apps apply there, and the settings page leaves the apps list as it is when it saves.

Edit this page on GitHub Margin 0.5.1 · MIT licence · made by Aaron Thomas