This script requires that clipman is installed. All you need to change is the location of the clipman history file.

As part of your niri configuration, add the following line to use clipman:
spawn-sh-at-startup “wl-paste -t text –watch clipman store –no-persist”

#!/bin/bash

FILE="/home/karmst/.local/share/clipman.json"

if [[ -f "$FILE" ]]; then
    choice=$(echo -e "Paste\nCopy\nWipe" | rofi -dmenu -p "Clipboard action")
    case "$choice" in
        Copy)
            cmd=$(clipman pick -t rofi --err-on-no-selection && wtype -M ctrl -M shift c)
            ;;
        Paste)
            cmd=$(clipman pick -t rofi --err-on-no-selection && wtype -M ctrl -M shift v)
            ;;
        Wipe)
            cmd=$(clipman clear -a)
            ;;
    esac
else
    notify-send "There is nothing in the clipboard"
fi

exit 0