Cinnamon launcher items not working

I wrote a program in Go and I am trying to add a launcher to the program in my taskbar. I can start the program without a problem from the terminal, regardless of if I am in the actual folder or in any other folder. If I instead try to start it using a Cinnamon launcher, the program does not start. I have tried Launch in terminal but that does not help.

launcher

There are no obvious clues in journalctl or xsession-errors. I am sure this is simple thing that I have still not understood about Linux, and I know that I have had this problem before, but I don’t see why. Any ideas?

Hello, it’s the same command you use in terminal? There is not any extension?

Exactly the same, in the terminal I can either run:

/opt/softdark/bin/softdark

from any folder, or I can run:

cd /opt/softdark/bin
./softdark

and the program starts fine. The file softdark is the executable.

When you click on browse, does your exec is recognised?
And if you tick launch in terminal?

Launch in terminal makes no difference.

When I click browse, it starts in my home folder, instead of in the /opt/softdark/bin folder. I don’t know if that matters, but I browsed the file, the correct path was entered, and when I clicked browse again I was back in the home folder. So it does not seem to recognize the folder, if that is what you meant…

Yes by default it starts to your home folder.
I tried a launcher linked to a /opt/… program, it’s not launching, and in the terminal, the same command asks for root privileges.
If you copy your program on your home or desktop, does the launcher work by any chance?

That was it!

It does start fine in my home folder. How do you solve that? Chown/chmod?

Yes you could try to modify the file permission.
Or if the path is not mandatory, create a specific folder for your program into your home.

1 Like

Chown the files did not change anything. I don’t know why.

I guess I have to start to put my own programs in my home folder instead.

Anyway, thanks for helping me finding out why this problem occurs, and a solution for it.

1 Like

Launch in terminal?

Directly in the terminal it worked. Ticking into the launcher, not.

What actually did help in the end was to not just take ownership of the individual files, but also to take ownership of the entire folder. The last step I did not do last night when testing…that was my bad, because I kind of knew that was needed already…

I am still wondering though, how am I allowed to run anything in the bin folder (owned by root also), but not files that I put in the opt folder? There is something still, that I don’t understand about Linux permissions. In my mind, I should not need to set the owner of the folder and files to my account, since I can run any executable in the bin folder owned by root.

There are also other executables in the opt folder, like balenaEtcher, my VPN-program, GitKraken, BitWarden etc. How can I execute those programs, that are also owned by root?

Anyway, I think I am done with putting my own programs in the opt folder, and I will start putting them in my home folder instead. I am the only user on my machines anyway, so it doesn’t really matter.

Wild guess but the other programs you mentioned maybe set the opt/… as accessible by all users, not only root, as a feature during their install.
But yes, if you don’t need specifically to put your own programs there, use your home instead.

How do you set a folder as accessible by all users?

I will use my home folder in the future, but I still want to understand why I have to take ownership of both the folder and files to get it to work in opt, and why it works for other programs that are owned by root:root. It just feels like something I need to know…:slight_smile:

It’s due to what opt was meant to be in Linux.

Check here /opt (more explained there permissions - Why should I be installing my applications in the /opt location? - Ask Ubuntu), but there are plenty other links about it.

Historically, 3d party programs should be installed there (even it’s not always respected nowadays, these rules are 30-40 years old as if it comes from UNIX).
You install a program with root privileges, it creates an /opt/program folder, with some subfolders. One of this subfolder with the executable will have rights for every users, or maybe only the executable. The other files/folders of this /opt/… will be kept their rights to root only.

TLDR, it’s a Linux/UNIX relic of how to make a program right.
For your own scripts/programs, keep it simple with a home subfolder.

https://wiki.archlinux.org/index.php/File_permissions_and_attributes#Changing_permissions

Aah, ok, the reason I started to put programs in /opt is that I saw a YouTube video where someone said the he put all his programs in /opt. And since then I have done so, without even thinking about it more.

It makes a little bit more sense now, I brought this onto myself, since I took advice from some guy on YouTube on how to do things :slight_smile:

I am going home now, to the home directory that is…:slight_smile:

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.