5

I've moved from 17.04 to 17.10 (by update, not fresh install)

I have a bunch of customized .desktop files in my desktop.

When I try to run then, I get a message telling me these are "untrusted", and I have to retrust them manually.

Is there a way to trust them all?

note:

  • desktop files have executable bit set (I have run chmod +x).
  • before trusting they appear as a generic file, after with proper icon (e.g. terminal, browser, ...)
  • worked fine before (that is icons and action were OK in 17.04)
  • desktop to samba share are OK.

edit:

  • files are not located in /tmp neither in $HOME.

I have read :

Execute-Permission Bit Required

  • Applications, including desktops and shells, must not run executable code from files when they are both: - lacking the executable bit - located in a user's home directory or temporary directory.
  • my desktop are in neither of those.
  • This includes *.desktop, *.jar, and *.exe files.
  • .desktop files being r--r--r-- or r-xr-xr-x won't execute.
  • Nothing may provide a workaround to run them anyway automatically ...

Update

  • 18.04 problem persist, accepted answer still work.
  • 19.04 problem persist, accepted answer no longer work (you must replace yes by true, however after reboot, .desktop not executable)
  • 20.04 use true instead of yes in accepted answer, or right-click "allow execution" from desktop (this might be troublesome for generated .desktop)
7
  • 2
    Possible duplicate of Permission of a .desktop file
    – JoKeR
    Oct 25, 2017 at 20:45
  • @JoKeR I did set +x bit ..
    – Archemar
    Oct 25, 2017 at 20:51
  • Did you read the policy from the answer mentioned in that post?
    – JoKeR
    Oct 25, 2017 at 20:58
  • @JoKeR I have that too, with files which permissions are set to 755 so this is not a dupe, its something new with 17.10
    – Videonauth
    Oct 25, 2017 at 21:09
  • might be reported as a bug then...
    – JoKeR
    Oct 25, 2017 at 21:15

1 Answer 1

6

I found my desktop files being mentioned in a binary file called ~/.local/share/gvfs-metadata/home which I could not edit. However, after some digging, I found the gio command. Run the following command followed by doing a refresh in nautilus

gio set yourfile.desktop "metadata::trusted" yes
7
  • does it work for you? Jan 14, 2018 at 8:04
  • 4
    hardest part was to find F5 command to refresh desktop :(
    – Archemar
    Jan 14, 2018 at 17:27
  • It worked for me, but only AFTER I did a refresh. This has been an irritation to me for several weeks before I finally found this solution. I hope it works for everyone. Jan 15, 2018 at 3:13
  • 1
    for all icons, do this ls -1 ~/Desktop/*.desktop | xargs -i gio set "{}" "metadata::trusted" yes and then hit the F5 key to refresh
    – knb
    Oct 24, 2018 at 15:22
  • 1
    I think this no longer works in 18.04 or 18.10. I don't know what the new solution is. Dec 28, 2018 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.