3 concerns:
1) You added UTF-8 conversion, but the "LANG=C" renders it useless. You should remove it
2) You need an IFS=$'\n' in order to support filespecs with spaces (essential for your " for i in $ITEMS" loop)
3) You send clicked items to xdg-open while my script sends them to rox -s. The command rox -s can never do harm. It just opens a ROX-Filer window. What xdg-open does depends on its configuration, but unless you have configured it differently it will run rox (without -s option) and therefore may execute scripts that were merely opened or edited in an editor and may not be suitable to be executed (not finished, interactive CLI script etc.). An item in the .xbel file always contains the name of the application that registered it, e.g
Code: Select all
<bookmark:application name="Leafpad" exec="'leafpad %u'" modified="2019-08-20T05:55:35Z" count="1"/>