I am running Ubuntu 22.04 on a machine with a server on it that controls two fullscreen applications. The first application is Firefox, running in kiosk mode, and the second is a fullscreen VLC instance. The computer is connected to two monitors. I'd like to display Firefox on one monitor, and VLC in another. Don't really care which is which as long as its consistent. I've run into a lot of problems using the usual recommendation of xdotool
or wmctrl
.
For starters, the applications always spawn togther, in full screen, on whichever display the mouse happens to be on. I don't have great control over the order in which the applications are started, so I can't just use xdotool
to move my mouse to correct display before spawning. Additionally, I've only been able to get xdotool
to move my mouse a couple times. Usually it will stay still (although I know it's doing something because the scroll bar pops up for a second on Firefox, as if I'd moved the mouse), very rarely will it move to the position specified.
I've also had very little success using wmctrl
to move windows. Specifying a specific xy location doesn't move the window at all.
The only way I've been able to get them on separate windows is with this command:
wmctrl -r "Firefox" -t 1
Which doesn't move the window immediately, but if I tap the Start button, the window shows up by the search bar and I can drag it to the correct monitor. Of course, this isn't acceptable as it's not programmatic. Unfortunately, I've no idea what is actually happening so I don't know where to begin to find out the programmatic way of doing this or even why using the -t
does what it does.
Here's how Firefox is spawned:
export DISPLAY=:0 && xdotool mousemove 0 1080 && firefox --kiosk localhost:3000
I was using xdotool
to move the mouse out of the way so it doesn't show on screen but this stopped working at some point.
And VLC:
DISPLAY=:0 vlc --intf http --http-port <port> --http-password <random password> --extraintf macosx,qt --no-video-title-show