You’ll have to put a corresponding .desktop file into
~/.local/share/applications and make sure that it has the proper permissions and attributes. As an example, i show the one i use for doing my backups.
Desktop entry file
Name=Backup to USB
Except for the Icon key, the file should be self-explanatory. Icon refers to a standard icon or can be a absolute path to a PNG/JPG image. For a exhaustive description of the desktop file format, please refer to https://specifications.freedesktop.org/menu-spec/menu-spec-1.0.html
Run the following two commands:
chmod +x ~/.local/share/applications/backup.desktop
gio set ~/.local/share/applications/backup.desktop metadata::trusted yes