JosefNemec / Playnite

Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
https://playnite.link
MIT License
9.18k stars 495 forks source link

Parameter for FullscreenApp.exe Call to Kill DesktopMode.exe #1372

Closed MEDumont closed 3 years ago

MEDumont commented 5 years ago

I would like an exe parameter for the FullscreenApp version of the exe to automatically terminate any existing instance of the DesktopApp. This helps with calling from SteamLink via a shortcut.

JosefNemec commented 5 years ago

I don't understand the use case here. Why not just start Playnite in Fullscreen mode in the first place?

MEDumont commented 5 years ago

I use Playnite on my local machine all the time, but sometimes I want to stream to my living room with SteamLink. I have Playnite as a shortcut on that steamlink, and it launches the Fullscreen mode fine, as long as the Desktop mode is not already running. So the ability to make one version kill the other version would be useful to me, though I recognize, not the default use-case.

Edit: Or better yet, when you attempt to launch FullscreenMode, and an instance of Playnite is already running in desktop mode, it could detect that and trigger the switch to Fullscreen mode.

Sabotageur commented 5 years ago

+1 on this issue. My use case :

This leaves the exit behaviour (how to exit from moonlight or steam link from playnite, ideally to get back to desktop mode) but that's another problem in itself and it's mainly concerning the streaming app and not so much playnite.

Sabotageur commented 4 years ago

I've solved it for my setup with a dirty bat script, I'm leaving it below if anyone is interested.

It does :

Once Playnite Fullscreen closes :

This requires :

Again, it's quite dirty, but I didn't want to spend too much time on it, and it works, so there you go.

taskkill /IM Playnite.DesktopApp.exe /F
J:\Playnite\Playnite.FullscreenApp.exe
start /D J:\Playnite\ J:\Playnite\Playnite.DesktopApp.exe

:stop
sc stop NvContainerLocalSystem

rem cause a ~10 second sleep before checking the service state
ping 127.0.0.1 -n 10 -w 1000 > nul

sc query NvContainerLocalSystem | find /I "STATE" | find "STOPPED"
if errorlevel 1 goto :stop
goto :start

:start
net start | find /i "NVIDIA LocalSystem Container">nul && goto :start
sc start NvContainerLocalSystem

exit 0
MEDumont commented 4 years ago

I solved mine by writing a script that would auto-kill playnite when launching steam link, but had to rewrite my steam link firmware to do so. Would be way easier to have it as a command line param.

Sabotageur commented 4 years ago

I've started working on implementing a "--switchpresentation" parameter in Playnite, which makes launched DesktopApp switch to full screen and vice versa. I'll drop a PR once I'm sure it's working properly and it doesn't disrupt anything.

magalhas commented 4 years ago

This is also my use case. No updates yet on this front?

JosefNemec commented 3 years ago

Done in Playnite 8.