Score:0

Start wine graphical application from .desktop file

us flag

Context

I'm trying to start Ableton Live which I installed through wine (and is working perfectly might I add!) by simply clicking on an icon in the taskbar.

Normal behavior

If I run the command from a terminal, which looks like wine /path/to/program.exe everything works perfectly: I get a bunch of information messages in the terminal, and a window pops up with Ableton inside it.

Problematic behavior

The problem is that as soon as I run it from a .desktop file nothing happens. I tried setting the Terminal=trueflag, and then it pops a terminal with the messages that I normally see on my terminal: so I know the program is launching... There is just no display.

My guess

I'm not an expert so forgive me if I use the wrong terms, but my guess is that it has something to do with the window server. Since when I start it from my session it's fine, but somehow when started from the .desktop it can't display, it seems the obvious culprit. I suppose it's started from another session that can't display windows. The only problem with that guess is I read everywhere that .desktop files are running commands as the user, I even ran whoami in a .desktop to confirm it... So I'm at a loss to what the next step is.

Thanks for your help!

Score:0
us flag

Ok so after playing around with it I came to the conclusion my initial hypothesis was wrong, the problem is not on the Linux side of things.

When you start wine, linux is mounted on drive Z: to the path of your terminal, for instance:

/some/path$ wine cmd.exe
Z:\some\path>

I guess wine needs that path to be coherent somehow, because I realized that when you start it from the .desktop the path doesn't match and all the issues I had stem from this. I fixed it by replacing the command:

wine "C:\path\to\program"

with

wine cmd.exe /c "C:" "&" "C:\path\to\program"

This way I completely remove the need to track where I am in Z:, and what do you know: now the UI shows up!

I'm not entirely sure why it works, but it does so... eh! I hope this can help someone else!

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.