I wrote myself a simple script, inspired by qutebrowser’s user-script which is probably similar to the dmenu script:
This uses rofi/wofi depending on whether X or Wayland are in use.