I have a machine running Ubuntu 20.04 and made a .desktop file. I tested it in my desktop and it worked, so i copied it to all existent users and did
sudo su; cd /etc/skel/; mkdir Desktop;
cp /home/MyUser/Desktop/MyIcon.desktop ./
So that all new users have access to the icon (the application is executable by all). However, when looking at what appears to other users, it is clearly not an executable .desktop file (comparison for what appears to my user and other users in images below).
what appears for my user What appears to other users
It seems doing what this answer suggests solves the issue, but i need to be the other_user doing this (where other_user is the user that will have the icon as an executable). So the only thing that can automatize the creation and correct configuration of the icon for new and existent users that comes to my mind is doing:
cd /path/to/other/user/Desktop
sudo su -l OtherUser
gio set app.desktop metadata::trusted true
for existent users and, for new future users:
cd /etc/skel/
and adding
gio set ~/Desktop/app.desktop metadata::trusted true
to .bashrc. This does not feel intelligent. Also, the sudo su -l option returns me an error:
gio: Setting attribute metadata::trusted not supported
Is there a better way for new users and a working way for already existent users?
Edit to add response to cbugk comment: content of file is in the form:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/usr/local/path/to/executable
Name=Name of application
Icon=/usr/local/path/to/image.png
0 Answers