Gaming on Linux (Wayland/Sway) has worked relatively well for years now (aside from anti-cheat issues). I run all my games under gamescope to avoid X11 glitches and ensure rendering at native resolution. But I did have two issues that I kept running into:

  1. Accidentally pressing system keybindings. I’d often press MOD+D by accident, which is my keybinding for my task launcher.
  2. Unable to set push to mute in Discord1. When you push to talk in game, you want Discord to mute your input so you don’t double send.

I’ve solved both of these problems with gamescope-mode-manager. This program listens for i32 IPC events and watches for specific app IDs to become focused. A Sway IPC call is then made to activate my custom gamescope mode which:

  1. Limits the number of bound symbols to avoid accidental presses.
  2. Configures SHIFT+F12 to toggle mangohud visibility via mangohudctl toggle no_display.
  3. Mutes Chromium input when t or mouse side button (button8) is pressed. I run Discord in Chromium.

In order to accomplish the last step, I needed to add a --passthrough argument to the bindsym directive of Sway. This small patch allows you to both run a command AND send the input to the application.


  1. The Wayland protocols do not allow global key bindings. Even if they did, it would take years for the compositors and applications to actually roll out support. ↩︎

  2. Sway is mostly compatible with i3 IPC. That’s why I can use the i3ipc package. ↩︎