I recently needed to add an item to the right-click desktop popup menu.
I decided to demonstrate it with a simple example. I chose this example
because someone wanted a clicky way to access and change the mirror.
Plus, it could be accomplished with Xprogs.tcz which I think gets installed
for all (most?) GUIs:
# This creates the file.
tc@E310:~/MakeMenuItem$ echo -e "#!/bin/sh\neditor /opt/tcemirror" > /"$HOME"/.wmx/Applications/TcMirror
# This is the file we just created.
tc@E310:~/MakeMenuItem$ cat /"$HOME"/.wmx/Applications/TcMirror
#!/bin/sh
editor /opt/tcemirror
# It needs to be made executable.
tc@E310:~/MakeMenuItem$ chmod 755 /"$HOME"/.wmx/Applications/TcMirror
# This adds it to the menu.
tc@E310:~/MakeMenuItem$ "$DESKTOP"_makemenu TcMirrorHere you see it's been added to the menu:

Create a file (name does not matter) in ~/.X.d/ that contains:
echo -e "#!/bin/sh\neditor /opt/tcemirror" > /"$HOME"/.wmx/Applications/TcMirror
chmod 755 /"$HOME"/.wmx/Applications/TcMirror
"$DESKTOP"_makemenu TcMirrorand the item will be added to the menu once the desktop starts.
The file does not need to be executable.
When you click on Applications->TcMirror , the editor , which is part
of Xprogs.tcz will open /opt/tcemirror.
If you decide you want to remove the item from the menu:
# This removes the TcMirror file you created.
tc@E310:~/MakeMenuItem$ "$DESKTOP"_rmitem TcMirror
# This removes the TcMirror entry from the menu.
tc@E310:~/MakeMenuItem$ "$DESKTOP"_makemenu TcMirror