Context
Currently i'm creating a customized ubuntu 20.04 LTS to be booted from live media (USB).
i'm trying to create a desktop shortcuts i.e. for the shutdown command.
i prepared a .desktop file shutdown.desktop
which include the following:
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Name=Shutdown
Comment=shutdown
Icon=/opt/icons/shutdown.svg
Exec=sudo shutdown -h now
Terminal=false
Categories=Development;
Name[fr_CA]=something_related_to_project
and updated the access right also
chmod 777 -R home/<user>/Desktop/shutdown.desktop
also ran
gio set shutdown.desktop metadata::trusted true
when i test the generated live media, the file is available on the desktop but it's not executable.
Attempts
When i display the context menu "allow launching" is not available.
from forums, i copied the file to /usr/share/applications
then from there i copied it back to desktop by replacing the existing file. At this point the "allow launching" is displayed but the file is still not executable.
When i click on "allow launching" and i double click the file, the command is executed.
Question
How can i configure, during the creation of the live media, my file that execute the shutdown command?
P.S: the procedure used to work with ubuntu 18.04 LTS