Biont / sway-launcher-desktop

TUI Application launcher with Desktop Entry support. Made for SwayWM, but runs anywhere
GNU General Public License v3.0
606 stars 28 forks source link

Unable to launch electron apps such as Discord #55

Closed afzalarsalan closed 2 years ago

afzalarsalan commented 2 years ago

Due to #54, I notice that some electron apps such as Discord no longer seem to launch at all.

In particular the error I get is exec: cd: not found

This issue doesn't occur with 1.5.2.

afzalarsalan commented 2 years ago

It seems that this issue directly correlates with the presence of a PATH variable in the .desktop file. When commenting out either or both PATH declarations in the file, the program seems to launch normally.

afzalarsalan commented 2 years ago

The stem of the issue derives from the fact that generate_command() prepends cd to the final parsed command which isn't understood by exec due to cd being a shell primitive and not a binary.

Biont commented 2 years ago

Thanks for debugging. I guess I will revert the release until we figure something out

Biont commented 2 years ago

@afzalarsalan Does it fix the problem if you change this line from

if(path){ printf "cd " path " && " }

to

if(path){ printf "env PWD=" path }
j0057 commented 2 years ago

Sorry about this, I hadn't hit a desktop file with Path= in my tests. It should work now for those as well.

afzalarsalan commented 2 years ago

@afzalarsalan Does it fix the problem if you change this line from

if(path){ printf "cd " path " && " }

to

if(path){ printf "env PWD=" path }

Unfortunately I can confirm that this fix does not work to resolve the issue, however I can confirm that #56 does end up resolving the issue appropriately