Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when running another mpv instance #14

Open
phanirithvij opened this issue Mar 24, 2020 · 10 comments
Open

when running another mpv instance #14

phanirithvij opened this issue Mar 24, 2020 · 10 comments

Comments

@phanirithvij
Copy link

phanirithvij commented Mar 24, 2020

When running another mpv instance before starting

wp run mpv ....

wp will push the existing mpv into the background instead of opening the new one in the background.

A video showing what I mean.

@phanirithvij
Copy link
Author

contents of videowalls.bat

wp run mpv ^
--player-operation-mode=pseudo-gui ^
--force-window=yes ^
--terminal=no ^
--no-audio ^
--sub=no ^
--loop=inf ^
--fullscreen ^
--input-ipc-server=\\.\pipe\mpvsocket ^
"D:\Images\VideoWallpapers"

wp mv --wait --class mpv -x 1920
wp add --wait --fullscreen --class mpv

@Francesco149
Copy link
Owner

Francesco149 commented Mar 24, 2020

yeah, you can't use class with multiple mpv's. you could set the window title by passing --title="something" to mpv and then using the window name to find it

@phanirithvij
Copy link
Author

phanirithvij commented May 8, 2020

So I was able to do it like this

wp run mpv ^
--player-operation-mode=pseudo-gui ^
--force-window=yes ^
--terminal=no ^
--title=wp ^
--no-audio ^
--sub=no ^
--loop=inf ^
--fullscreen ^
--input-ipc-server=\\.\pipe\mpvsocket ^
"D:\Images\VideoWallpapers"

wp mv --wait --name wp -x 1920
wp add --wait --fullscreen --name wp

How can I kill that specific mpv instance?

Right now I'm doing

taskkill /im mpv.exe /f
wp.exe killall

Which kills all the running mpv instances.

@Francesco149
Copy link
Owner

wp kill --name wp or wp killall --name wp

@phanirithvij
Copy link
Author

It doesn't work.
The mpv is still there. One more thing, I don't see wp in task manager when it is running

image

@phanirithvij
Copy link
Author

Got something working to kill that wallpaper mpv instance (terrible hack sorry)

set cmd=powershell -c "get-process mpv | where-object {$_.mainwindowhandle -eq 0} | select-object Id"
:: https://stackoverflow.com/a/27429851/8608146
for /F "delims=" %%a in ('%cmd%') do (
   set "lastButOne=!lastLine!"
   set "lastLine=%%a"
)
taskkill /PID %lastLine% /f
REM timeout 5000

:: This does nothing (??)
wp.exe killall --name wp

@Francesco149
Copy link
Owner

hmm that's strange. wp kill and wp killall both find the window in the same way wp mv does. so I don't see how it wouldn't find it. I'll look into this when i have time I guess

@phanirithvij
Copy link
Author

The title of mpv is getting removed when it is set as a wallpaper for some reason. That's why I was able to filter that mpv process by no title and get the pid.

@phanirithvij
Copy link
Author

Btw I am once again asking for the battlefield video wallpaper that's in th readme

@Francesco149
Copy link
Owner

that makes sense. but how does the mv command work then? hmm

well if the window can't retain its title it's gonna be hard to make wp kill work

and I don't have that wallpaper anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants