El Foro

[Deprecated Plugin] WaitWine

Wait for the exit of a POL-program

Autor Respuestas
Joriktos Saturday 1 November 2014 at 16:57
JoriktosAnonymous

Hi POL-community,

I had some trouble to get my NVIDIA-card running with League of Legends, so I wrote a little script which helped me to get it working.

Description what my script does:
Sometimes you want to start a program with PlayOnLinux and want to call another script after the program has finished or while it's execution. Unfortunately the Shortcut (Starterscript) of POL is calling the program and exits then, so you can't wait for it. With WaitWine another little script is added to the shortcut, which checks every 5 seconds if Wine (wineserver process) is still running. If Wine isn't running anymore the script exits.
This is useful for example for optirun (Bumblebee-package).

Now i wrote a little plugin which either adds or removes the script to the end of a POL-shortcut.
I can now run my desktop-shortcut with

optirun /usr/share/playonlinux/playonlinux --run "League of Legends"

 

Download: http://www.file-upload.net/download-9780397/WaitWine.tar.gz.html
Unzip this file into the plugindirectory (~/.PlayOnLinux/plugins) of PlayOnLinux, then you can find it in the POL-Menubar

 

I hope this script is useful for the community. There should be no bugs, but if you find some, then contact me in this forum.

Have a nice day
Joriktos

 

Editado por: Joriktos

Ronin DUSETTE Sunday 2 November 2014 at 0:24
Ronin DUSETTE
Admin

Can you give a more practical, real-world example of this?


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
petch Sunday 2 November 2014 at 2:20
petch
Developer

Hi,

grepping ps ax output is both inherantly unefficient and fragile (will break if any other wineserver is running, for another virtual drive, or any other user (why "ax" anyway?); or even if the "wineserver" string is found in some other process parameters, etc.)

What about using wineserver -w instead?

 

petch Sunday 2 November 2014 at 2:58
petch
Developer

And beside the fact that the use of plugins is depreciated (if you think this is an useful feature, better add it directly to PlayOnLinux/PlayOnMac), I'd like to mention two other approaches to the problem, both moving the burden off the users:

- make shortcuts wait to for exit of the wineserver, unconditionally. I can think of some scenario where it would temporarily stack up waiting shell processes (have in the same virtual drive both a long running program and a short running program that is launched repeatedly), but I'm not sure if that's a no-go

- leave it to install scripts to add wineserver -w statement at the end of shortcuts that need it; in other words, decide it's not a PoL/PoM problem

Joriktos Sunday 2 November 2014 at 15:52
JoriktosAnonymous

@Ronin DUSETTE: I don't have another "real-world example" and my knowledge of english isn't as good as i could describe my script in a better way, I'm sorry.

@petch: As I googled for a way to get listed all processes, I found this as the first solution and as it worked like I wanted, I used this in my script. I didn't think about performance, because I also didn't think about publishing it later and my Computer is fast ;) About the way with wineserver -w I found nothing helpful on the web. Did you mean, that I have to use this in the POL_Wine () function, or where should i use this?

- With your described scenario you brought up some thoughts I also had. But for my own i only use one wine-application at the same time and if I use them, then with optirun, so for my case this way was a useful solution. And why should it stack up? I can't imagine a situation where this should happen.

- If I type wineserver -w in the console, nothing happens..

 

Edit: Damn.. So much useless work.. Now i know what you meant with wineserver -w at the end of the script.. So i wrote a useless plugin angrylaugh But that doesn't matter, I learned much about POL and the bash syntax, so it was not in vain wink

Have a nice day

Editado por: Joriktos

Joriktos Sunday 2 November 2014 at 16:06
JoriktosAnonymous

Could you add the "wineserver -w"-line into your shortcuts by default in your next POL-Version? Or is this disturbing the function of POL in some cases?

Ronin DUSETTE Sunday 2 November 2014 at 16:30
Ronin DUSETTE
Admin

 

Could you add the "wineserver -w"-line into your shortcuts by default in your next POL-Version? Or is this disturbing the function of POL in some cases?

 

Again, we would need a practical reason to have this by default, considering only one user seems to need it. lol.  

Editado por: RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
petch Sunday 2 November 2014 at 19:57
petch
Developer

Most programs launched thru POL_Wine behave synchronously (only give back control when they're done), so in the vast majority of the cases nothing should be required.

It's only some programs, that are probably just launchers (start another program and themselves immediately exit after that) that have this synchronous behavior and would require some specific attention so that the shortcut waits for the main program to stop.

So it has to be considered on a case-by-case basis,

I tried something for LoL but it still needs testing.