wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Window position and size for mpv video player

Open karlkliem opened this issue 1 year ago • 2 comments

On a Raspberry Pi 4 with the latest Raspberry Pi OS (Debian Bookworm) with Wayland, what do I have to write into ~/.config/wayfire.ini to be able to play back a video on HDMI-A-1 and a second video on HDMI-A-2? Which options can I use in the CLI with MPV to make this happen? Seems like the usual way to do it in mpv doesn't work, for example "mpv --geometry=640x480+50+50 video.mp4".

karlkliem avatar Sep 19 '24 16:09 karlkliem

The client can only set it's size, not position. First, you will want to set a unique application identifier for each mpv instance by passing --wayland-app-id="unique-id". Then, using this app-id, set up some window rules. Enable window rules plugin and in wayfire.ini, use something like:

[window-rules]
rule1 = on created if app_id is "unique-id-1" then start_on_output "HDMI-A-1"
rule2 = on created if app_id is "unique-id-2" then start_on_output "HDMI-A-2"

However, this requires a more recent version of wayfire than what is in bookworm by default. You would need this commit at least. You might consider upgrading to 0.9 or master, using wf-install script.

With wayfire in bookworm, you should be able to at least use oswitch plugin to move a view to another output with a keybinding.

soreau avatar Sep 19 '24 16:09 soreau

Thanks a lot. I didn't get it to work right away. For now I switched back to X11. It works much easier for me with the mpv player choosing the output screen with mpv --fs --screen=1 video.mp4

karlkliem avatar Sep 20 '24 19:09 karlkliem

For fullscreen apps, this is essentially a duplicate of #1752 , for other apps, one can use the IPC functionality in new wayfire versions.

ammen99 avatar Jun 23 '25 10:06 ammen99