I wanted MPV to start playing in fullscreen when the computer is left idling. I wrote a Python script that calls MPV with parameters that cause it to go fullscreen, loop the video and quit on any input. But I have run into an unexpected problem.
If I run mpv directly, or run my script, from Yakuake or from Alt+F2, it all works fine, and MPV takes the whole screen.
However, if I set my script to run on idle in Power settings, then when MPV opens, plasma panels are drawn on top of it.
I know that the culprit is Focus Stealing Prevention, and I can solve the problem for myself by creating a Window Rule to disable it for my instance of MPV. However, I want to distribute my script and I value simplicity — and I really don’t want to tell my users that they need to create a window rule to use my script. For the same reason i don’t want to alter mpv in any way for it.
So how can I either:
- Disable Focus Stealing Prevention for an application before running it
- Create a Window Rule programmatically without user input
- Force MPV to get on top of panels in any other way?
Thanks!