Can I write a bash script and add it into right-click list of the graphical file explorer?

Solution 1:

Yes you can. The file manager Files (nautilus) has a feature "nautilus scripts". When this folder exists and contains executable scripts, a "Scripts" entry will appear in the right-click menu that will include these scripts. See the Ubuntu Community Help Wiki to see how you can use predefined variables containing the selected file names, the current directory, etc.