Score:1

.desktop file cannot be marked as trusted in Ubuntu 22.04

cn flag

I migrated from my old Ubuntu 20.04 computer to my new Ubuntu 22.04 computer. Once the Ubuntu was installed on my new computer I did the migration over my router using these commands on the new computer:

rsync -az [email protected]: /home /
rsync -az [email protected]:/opt /

Where: [email protected] is the network ID of my old computer.

After this migration I found I was unable to mark any of the .desktop files as trusted. On the desktop display their icons were grayed out, and they had the red dot with the white x in them. A right click on the icon displays a menu that does not have a mark as trusted menu item.

Newly made .desktop files also could not be marked as trusted. But .desktop items made in other accounts created in the new computer for testing could be. So I figure that somehow the way I migrated borked the main account I migrated to. Now I need to know how to fix my main account so it allows marking its .desktop files as trusted.

I attempted to fix it by deleting all .desktop files. I then created a new .desktop file launcher for a newly installed flameshot app.

The icon appears as shown in this image:

Grayed out Flameshot.desktop icon

I marked it executable as shown in this image: Flameshot.desktop icon permissions

Still no option to mark this .desktop file as trusted appears when its icon is right clicked. So I attempted to do this by means of this terminal command:

sudo -u stephen -g stephen dbus-launch gio set "/home/stephen/Desktop/Flameshot.desktop" metadata::trusted yes

as recommended in this thread: How to mark a .desktop file as trusted from command line on Ubuntu 18.04?

The command executed without error, yet failed to mark the icon as trusted, and so the icon still does not work to launch Flameshot.

Is there a system log that can tell me why the gio command failed to mark the file as trusted? I used the Logs application to looked for this and did not see it.

What do I need to do to fix my main account?

The filesystem is ZFS Encrypted and RAID 1 Mirrored.

More information:

The contents of the Flameshot.desktop file:

[Desktop Entry]
Comment=Powerful yet simple to use screenshot software.
Comment=Powerful yet simple to use screenshot software.
Comment[en_US]=Powerful yet simple to use screenshot software.
Exec=flameshot launcher
GenericName=
GenericName=
GenericName[en_US]=
Icon=flameshot
MimeType=
Name=Flameshot (Snappy Edition)
Name=Flameshot (Snappy Edition)
Path=
StartupNotify=false
Terminal=false
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-Desktop-File-Install-Version=0.26
X-KDE-SubstituteUID=false
X-KDE-Username=

There are duplicate entries in this file. I do not know how that happened.

"gio info" command in the account where the flameshot icon cannot be be made launchable:

stephen@stephen:~$ gio info -a 'metadata::*' /home/stephen/Desktop/Flameshot.desktop
uri: file:///home/stephen/Desktop/Flameshot.desktop
local path: /home/stephen/Desktop/Flameshot.desktop
unix mount: hpool/USERDATA/stephen_w05kv5 /home/stephen zfs rw,relatime,xattr,posixacl
attributes:
  metadata::gedit-encoding: UTF-8
  metadata::gedit-position: 171
  metadata::gedit-spell-language: en
  metadata::nautilus-drop-position: 
  metadata::nautilus-icon-position: 409,2
  metadata::trusted: true
stephen@stephen:~$

In spite of the metadata key: "trusted" being set to "true" in the above, its icon displays as not launchable in the desktop, and no "Allow Launching" option appears in the pop up menu when this icon is right clicked.

"gio info" command in the account where the flameshot icon is launchable:

test@stephen:~$ gio info -a 'metadata::*' /home/test/Desktop/Flameshot.desktop
uri: file:///home/test/Desktop/Flameshot.desktop
local path: /home/test/Desktop/Flameshot.desktop
unix mount: hpool/USERDATA/test_h2xrm6 /home/test zfs rw,relatime,xattr,posixacl
attributes:
  metadata::nautilus-icon-position: 2996,938
  metadata::trusted: true
test@stephen:~$

I have Ubuntu 22.04 on a ZFS filesystem with RAID 1 mirror, and encryption.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.