when running another mpv instance
phanirithvij opened this issue · 10 comments
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.
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
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
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.
wp kill --name wp
or wp killall --name wp
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
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
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.
Btw I am once again asking for the battlefield video wallpaper that's in th readme
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