0

I try to set a desktop file into the "allow launching" state in my installation script running as root. I tried following different ways to get it done:

    gio set "/home/ubuntu/Desktop/raspiBackupInstallUI.desktop" metadata::trusted true  # set allow launching
    sudo -u ubuntu -g ubuntu dbus-launch gio set "/home/ubuntu/Desktop/raspiBackupInstallUI.desktop" metadata::trusted yes
    runuser -l ubuntu -c "gio set /home/ubuntu/Desktop/raspiBackupInstallUI.desktop metadata::trusted yes"

But every command fails. The interesting point is: When I execute

gio set "/home/ubuntu/Desktop/raspiBackupInstallUI.desktop" metadata::trusted true

later on as user ubuntu the Desktop file is set to "allow launching". For me it looks like it's somehow related to the fact the commands are executed by user root instead of user ubuntu.

Does somebody know what's wrong with the commands I use and which command will "allow launching" even it's executed as root?

0

You must log in to answer this question.

Browse other questions tagged .