When using a multi-monitor setup and Sway on Wayland, bemenu doesn’t appear on the monitor it is called from. This program fixes that
Download this repository and compile the Haskell file:
cabal build
Change the bemenu option in your Sway configuration file to the following:
set $menu dmenu_path | bemenu -m "$(PATH-TO-REPOSITORY/bemenuFocus)" | xargs swaymsg exec --
Reload Sway and you should find that bemenu now appears on the active monitor. This should work if you have less than 10 monitors.
This is now a nix flake, so you can install it on your system if you use nix with flakes enabled. Running
nix build
in the repository will build the programme.
If you want to get things like passmenu (or other programs that call bemenu) you need to make them call:
bemenu -m "$(PATH-TO-REPOSITORY/bmenuFocus)"
rather than just “bemenu”. You can find the location of files (in this case, passmenu) by running
whereis passmenu
and changing it accordingly.