I run multiple tmux sessions inside ghostty terminals on niri, and wanted global keybindings that jump directly to a specific pane — e.g. press one key to land on my music player, another to land on my editor. niri's app_id matching + tmux's list-panes make this possible.

The tmux-* and niri-* scripts here contain that magic.

Example niri binds

  Binds {
      Mod+M { spawn "tmux-focus-pane.sh" "ncspot" "etc"; }
      Mod+E { spawn "tmux-focus-pane.sh" "nvim" "main"; }
      Mod+T { spawn "niri-focus-or-open-tmux.sh" "main"; }
  }

Mod+M jumps straight to the pane running ncspot in my etc instance. Mod+E jumps to nvim in my main instance. If the ghostty window isn't open yet, it gets created. If the process isn't running in any pane, I get a fuzzel session picker instead.