With my former Yubikeys I was used to use yubikey-oath-dmenu for (T)OTP.

As I found no similar solution for Token2, I wrote a wrapper script around t2-cli.

I downloaded t2-cli from the Token2 customer are and extracted it to my personal bin folder.

The wrapper uses wofi for the dmenu style selection and copies the code to the clipboard using wl-copy as I use wayland.

#!/bin/bash

cd ~/bin/t2-cli/6750b8d29e3ad
source venv/bin/activate
DATA=$( python3 app.py get_all | wofi --dmenu --matching=fuzzy )
WOFIRET=$?
if [ $WOFIRET == 0 ]
then
    APP=$( echo $DATA | awk -F' ' '{print $2;}' )
    ACC=$( echo $DATA | awk -F' ' '{print $4;}' )
    CODED=$( python3 app.py read_entry --app-name $APP --account-name $ACC )
    CORET=$?
    if [ $CORET == 0 ]
    then
        CODE=$( echo $CODED | awk -F' - ' '{print $2;}' )
        echo $CODE | wl-copy
    fi
fi