Sample Header Ad - 728x90

.desktop files on Red Hat desktop launches gedit ONLY from desktop shortcut

1 vote
2 answers
435 views
I have .desktop files (shortcuts) on a RHEL 8.8 machine that are set up correctly and work on other RHEL systems, but for some reason, whenever trying to launch (double click) on these desktop files FROM the GUI it opens them in gedit. There used to be an option when right clicking on these files to "Allow Launching" which was part of our installation instructions for customers but that doesn't exist in the RMC menu anymore for any of the .desktop files. They are all set to executable. I installed the GNOME Tweaks and other add-on extensions and it's all set to use shortcuts. My software's shortcut is proprietary so I'm sharing one for Perforce. Getting a crash course in MIME types and GNOME desktop, but nothing is helping. I am comparing the /usr/share/application and /usr/share/packages locations and so far everything matches the systems where this functionality WORKS. Here's an example of one of the .desktop files:
[Desktop Entry]
Type=Application
MimeType=application/x-desktop
Name=P4V
Icon=/home/tcgllc/Perforce/p4v-2023.4.2558838/lib/P4VResources/icons/p4v.svg
Exec=/home/tcgllc/Perforce/p4v-2023.4.2558838/bin/p4v
Terminal=false
Path=/home/tcgllc/Perforce/p4v-2023.4.2558838/bin
One crazy aspect of this is that double clicking on them in the Files app (opened to ~/Desktop) works! It's JUST the .desktop files, in ~/Desktop, via double clicking on the gui. Tried all of the following: Copied P4V.desktop to /usr/share/applications
gio set P4V.desktop metadata::trusted true
gio set P4V.desktop metadata::trusted yes
xdg-mime default P4V.desktop application/x-desktop
update-desktop-database /usr/share/applications
update-mime-database /usr/share/mime
xdg-desktop-menu install /usr/share/applications/P4V.desktop --novendor
when I run file --mime P4V.desktop the output is
/home/tcgllc/Desktop/P4V.desktop: text/plain; charset=us-ascii
I have the free RHEL Developer subscription but it's self supported, RHEL Knowledgebase has been searched. I've been pulling my hair out for 2 days. I've tried everything I could find on google and I'm screaming uncle. If anyone can help me with this issue I would be immensely grateful! TIA KL Editing to add what I've tried based on chubblywarner's comments (sorry new here, I just saw it said to edit original post!?) YES you are correct in all of your initial points. I ended up re-creating the .desktop file and removing the copies of it I had placed all over the system to "start fresh". $ nano P4V.desktop (made updates to .desktop file) $ chmod +x ~/Desktop/P4V.desktop $ sudo update-mime-database /usr/share/mime $ sudo update-desktop-database $ gio info P4V.desktop standard::icon: application-x-desktop, text-x-generic standard::content-type: application/x-desktop standard::fast-content-type: application/x-desktop standard::symbolic-icon: application-x-desktop-symbolic, text-x-generic-symbolic, application-x-desktop, text-x-generic access::can-read: TRUE access::can-write: TRUE access::can-execute: TRUE access::can-delete: TRUE access::can-trash: TRUE access::can-rename: TRUE owner::user: tcgllc owner::user-real: tcgllc owner::group: tcgllc selinux::context: unconfined_u:object_r:user_home_t:s0 xattr-sys::security.selinux: unconfined_u:object_r:user_home_t:s0 metadata::nautilus-icon-position: 0,283 $ xdg-mime default P4V.desktop application/x-desktop $ gsettings get org.gnome.nautilus.preferences executable-text-activation 'launch' $ grep -r "application/x-desktop" ~/.config /etc/xdg /home/tcgllc/.config/mimeapps.list:application/x-desktop=org.gnome.gedit.desktop; /home/tcgllc/.config/mimeapps.list:application/x-desktop=P4V.desktop $ getenforce Permissive I'm not sure if anything below is useful, but it does look like there are warnings, permission issues? $ journalctl -b | grep -i desktop .... Aug 29 15:52:04 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/update-desktop-database Aug 29 15:52:21 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/update-desktop-database Aug 29 15:53:12 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/xdg-mime default P4V.desktop application/x-desktop Aug 29 15:53:52 TEW-LINUX gnome-session: gnome-session-binary: WARNING: Unable to inhibit system: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied Aug 29 15:53:52 TEW-LINUX gnome-session-binary: WARNING: Unable to inhibit system: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied Aug 29 15:53:53 TEW-LINUX gnome-shell: desktop-icons: File System Manager.desktop is writable by others - will not allow launching Aug 29 15:54:51 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/xdg-mime default P4V.desktop application/x-desktop Aug 29 15:55:15 TEW-LINUX sudo: tcgllc : TTY=pts/1 ; PWD=/usr/share/applications ; USER=root ; COMMAND=/bin/rm P4V.desktop Aug 29 16:23:31 TEW-LINUX gnome-session: gnome-session-binary: WARNING: Unable to inhibit system: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied Aug 29 16:23:31 TEW-LINUX gnome-session-binary: WARNING: Unable to inhibit system: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied Aug 29 16:26:53 TEW-LINUX org.gnome.Shell.desktop: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2400101 Aug 29 16:29:05 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/update-mime-database /usr/share/mime Aug 29 16:29:16 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/update-desktop-database Aug 29 16:31:35 TEW-LINUX org.gnome.Shell.desktop: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2000007 _updateDesktopIfChanged@/usr/share/gnome-shell/extensions/desktop-icons@gnome-shell-extensions.gcampax.github.com/desktopManager.js:415:21 _monitorDesktopFolder/<@/usr/share/gnome-shell/extensions/desktop-icons@gnome-shell-extensions.gcampax.github.com/desktopManager.js:368:89 Aug 29 16:32:27 TEW-LINUX gnome-shell: desktop-icons: File System Manager.desktop is writable by others - will not allow launching Aug 29 16:33:09 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/update-mime-database /usr/share/mime Aug 29 16:33:41 TEW-LINUX sudo: tcgllc : TTY=pts/0 ; PWD=/home/tcgllc/Desktop ; USER=root ; COMMAND=/bin/update-desktop-database Aug 29 16:36:02 TEW-LINUX org.gnome.Shell.desktop: Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x2400101 Then, the final few commands: $ gnome-shell --version GNOME Shell 3.32.2 $ rpm -qa | grep gnome gnome-desktop3-3.32.2-1.el8.x86_64 gnome-shell-3.32.2-50.el8.x86_64 gnome-shell-extension-common-3.32.1-39.el8_10.noarch gnome-shell-extension-top-icons-3.32.1-39.el8_10.noarch chrome-gnome-shell-10.1-7.el8.x86_64 gnome-online-accounts-3.28.2-4.el8.x86_64 gnome-system-monitor-3.28.2-1.el8.x86_64 gnome-control-center-filesystem-3.28.2-37.el8.noarch gnome-terminal-3.28.3-3.el8.x86_64 gnome-shell-extension-places-menu-3.32.1-39.el8_10.noarch gnome-screenshot-3.26.0-3.el8.x86_64 gnome-session-wayland-session-3.28.1-19.el8.x86_64 gnome-bluetooth-libs-3.34.3-1.el8.x86_64 gnome-session-xsession-3.28.1-19.el8.x86_64 gnome-keyring-pam-3.28.2-1.el8.x86_64 gnome-control-center-3.28.2-37.el8.x86_64 gnome-shell-extension-window-list-3.32.1-39.el8_10.noarch gnome-font-viewer-3.28.0-1.el8.x86_64 gnome-user-docs-3.28.2-1.el8.noarch gnome-menus-3.13.3-11.el8.x86_64 gnome-tweaks-3.28.1-7.el8.noarch gnome-video-effects-0.4.3-3.el8.noarch gnome-themes-standard-3.22.3-4.el8.x86_64 gnome-shell-extension-horizontal-workspaces-3.32.1-39.el8_10.noarch gnome-classic-session-3.32.1-39.el8_10.noarch gnome-initial-setup-3.28.0-11.el8.x86_64 gnome-color-manager-3.28.0-3.el8.x86_64 gnome-calculator-3.28.2-2.el8.x86_64 gnome-shell-extension-user-theme-3.32.1-39.el8_10.noarch gnome-settings-daemon-3.32.0-19.el8.x86_64 libgnomekbd-3.26.0-4.el8.x86_64 gnome-shell-extension-launch-new-instance-3.32.1-39.el8_10.noarch gnome-software-3.36.1-11.el8.x86_64 gnome-bluetooth-3.34.3-1.el8.x86_64 gnome-session-3.28.1-19.el8.x86_64 gnome-keyring-3.28.2-1.el8.x86_64 gnome-autoar-0.2.3-2.el8.x86_64 gnome-shell-extension-apps-menu-3.32.1-39.el8_10.noarch gnome-boxes-3.36.5-8.el8.x86_64 gnome-terminal-nautilus-3.28.3-3.el8.x86_64 gnome-logs-3.28.5-3.el8.x86_64 gnome-getting-started-docs-3.28.2-1.el8.noarch gnome-shell-extension-desktop-icons-3.32.1-39.el8_10.noarch gnome-disk-utility-3.28.3-2.el8.x86_64 gnome-remote-desktop-0.1.8-3.el8.x86_64 gnome-characters-3.28.2-1.el8.x86_64 $ $ ls -l ~/Desktop/P4V.desktop -rwxrwxr-x. 1 tcgllc tcgllc 298 Aug 29 16:32 /home/tcgllc/Desktop/P4V.desktop I appreciate SO MUCH all of your help in diagnosing this weirdness. Unfortunately, I still only get gedit double clicking on the .desktop file ON the desktop. And still, when I double click on the .desktop files in the Files App, it will launch correctly. I'm going to include a visual of this. I do get the "Untrusted application launcher" pop up the first time running P4V.desktop in the Files App. Thereafter, the icon shows as expected. enter image description here Also, if I am responding to or communicating with you incorrectly, let me know what I should do if different. :) TYSVM
Asked by Klyn610 (11 rep)
Aug 29, 2024, 01:51 PM
Last activity: Jul 17, 2025, 03:49 PM