Sounds like you're trying to define a 'Custom Action'. Some nice documentation for those can be found at https://github.com/lxqt/pcmanfm-qt/wiki/custom_actions

Holger