OK, I've been beating my head against this for two hours and trying not to have to post it as a question, but I give up. I migrated today to a new Ubuntu 24.04 installation, and I can't get my FaveProgram.desktop files to work. These are files that define GUI launcher icons to run a particular CLI command (e.g. "faveprogram -option attribute"), and I have searched and tried and searched and hacked and tested and aaaarrrrgghh...
When I "run" the icon, it always opens the default text editor. Here's what I've tried:
- right click -> Run As Program
- right click -> Open With -> Run Software
- set as executable graphically in GUI
- set as executable manually with chmod (confirmed)
- gio set FaveProgram.desktop metadata::trusted {yes true TRUE} (tried them all)
- note: "Allow To Launch" is NOT available in the right-click menu!
- starting from scratch with new .desktop file
I watched /var/log/syslog and it says something about a VTE spawn problem. That might be a red herring but I'm mentioning it in case someone has a tip on a next step there.
I started to try to look into xdg-mime but I didn't understand it.
Here's the contents of the .desktop file I'm trying to run:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=true <-- normally false, tried true anyway
Exec=/usr/bin/program -option value <-- yes it exists, can run manually
Name=FaveProgram
Comment=FaveProgram
Icon=/valid/path/to/icon.png
EDIT: Found the "edit" link here, wasn't visible before. Adding a few more things:
- thanks to admin @mook765 for quickly editing this question to format my code
- I did try removing the xdg-open, no improvement
- I've previously been running these icons from arbitrary folders, via Nautilus / Files / file manager, not from GUI menus; re an XDG application folder, which one should I try?
- thanks @david; I did try that the first method suggested in that thread and it didn't work, will move on to the others shortly
In case the VTE errors in syslog lead to problem, here is the burst of errors I get there when I try to "run as program":
- 2025-03-06T15:58:58.273700-05:00 shuttle4 systemd[1379]: vte-spawn-8a9d9df0-2262-4e79-b9be-15b00bcdf6b5.scope: PID 48562 vanished before we could move it to target cgroup '/user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-8a9d9df0-2262-4e79-b9be-15b00bcdf6b5.scope', skipping: No such process
- 2025-03-06T15:58:58.273830-05:00 .... No PIDs left to attach to the scope's control group, refusing
- (two more lines, char limited)