The snap exec do not run when clicking icon

My snap can be launched via command line. All is OK.

But when I click icon, the script of snap can be run, but exec was not run.

Who can help me?

BTW: I’ve tried snappy-debug, it shows nothing

Can you show the desktop file in /var/lib/snapd/desktop/<your-snap-name>_<your-snap-name>.desktop

root@visual-lvm-builder:~# ll /var/lib/snapd/desktop/applications/
total 24
drwxr-xr-x 2 root root 4096 2月  26 19:27 ./
drwxr-xr-x 4 root root 4096 7月  13  2021 ../
-rw-r--r-- 1 root root   13 2月  26 19:27 mimeinfo.cache
-rwxr-xr-x 1 root root  441 2月  26 19:27 visual-lvm-remote_visual-lvm-remote.desktop*

The script can be run but exec was not run

Sorry, but I wanted you to run

cat /var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop

please give the output of this command.

The content is

root@visual-lvm-builder:~# cat /var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop 
[Desktop Entry]
X-SnapInstanceName=visual-lvm-remote
Name=Visual LVM Remote
GenericName=Visual LVM Remote
Comment=The remote/local GUI LVM manager
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop /snap/bin/visual-lvm-remote.start
Terminal=true
Type=Application
Icon=/snap/visual-lvm-remote/x1/meta/gui/visual-lvm-remote.png
Categories=Utility;LVM;
StartupNotify=false
MimeType=

What do you get, when you run this in your terminal

env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop /snap/bin/visual-lvm-remote.start

It runs well as command “/snap/bin/visual-lvm-remote.start”

env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop /snap/bin/visual-lvm-remote.start

First running, we need to do some configure work ...
Specify work port : [8341]

Then… it’s probably not an issue in the desktop file. Because that’s the command that’s run when clicking on the desktop file

It is strange that if I run in command line, it runs well. But when run from desktop file, the script runs but exec fail…

Thank you

Is this snap available in the store? I can give that a try

There is a bug, may be related to the one you experience

Yes, the snap name is visual-lvm-remote

Thank you very much

env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop /snap/bin/visual-lvm-remote.start

This is command, and it just shows up the terminal to run it. It doesn’t need any interaction

The result of command you provided:

root@visual-lvm-builder:/proj/vlvm/x86_64/visual-lvm-remote# env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/visual-lvm-remote_visual-lvm-remote.desktop /snap/bin/visual-lvm-remote.start

First running, we need to do some configure work ...
Specify work port : [8341]
port 8341
weLees Visual LVM Remote configure console V mod2 step 1182

  Change work port to 8341.
  Setting changed.
The default username is admin for login
Do you want to change login password(default is admin) ? [Y/n]n
Settings done.
Snapcraft edition does not support run automatically after boot.
Please enable port 8341 and run 'visual-lvm-remote.start' to run Visual LVM.

The support page : https://www.welees.com/lvm-support.html

The user guide page : https://www.welees.com/visual-lvm-user-guide.html

Wish Visual LVM helps you work more easily & more efficiently
      -- weLees Visual LVM group

Visual LVM Remote V Mod2 console start ...<<<<<<<<<<<<<<<<<<<<<desktop running stop here, information followed is from exec
root@visual-lvm-builder:/proj/vlvm/x86_64/visual-lvm-remote# Visual LVM Remote MKV Mod2 build at Mar  2 2024 23:11:11

---------------------------------------
WeLees Server on port 8341
---------------------------------------

And the result of command “visual-lvm-remote.start”:

root@visual-lvm-builder:/proj/vlvm/x86_64/visual-lvm-remote# visual-lvm-remote.start 

First running, we need to do some configure work ...
Specify work port : [8341]
port 8341
weLees Visual LVM Remote configure console V mod2 step 1182

  Change work port to 8341.
  Setting changed.
The default username is admin for login
Do you want to change login password(default is admin) ? [Y/n]n
Settings done.
Snapcraft edition does not support run automatically after boot.
Please enable port 8341 and run 'visual-lvm-remote.start' to run Visual LVM.

The support page : https://www.welees.com/lvm-support.html

The user guide page : https://www.welees.com/visual-lvm-user-guide.html

Wish Visual LVM helps you work more easily & more efficiently
      -- weLees Visual LVM group

Visual LVM Remote V Mod2 console start ...   <<<<<<<<<<<<<<<<<<<<<desktop running stop here, information followed is from exec
root@visual-lvm-builder:/proj/vlvm/x86_64/visual-lvm-remote# Visual LVM Remote MKV Mod2 build at Mar  2 2024 23:11:11

---------------------------------------
WeLees Server on port 8341
---------------------------------------

I didn’t get any such log… may be someone with experience on that particular thing might help better.

Thank you. Maybe this really is a snap bug.