I'm trying to run 2 apps automatically after boot on raspberry pi 4. I already able to make them run after boot by using autorun file but i have no idea how to assign them to run on the selected screen(i.e: screen 1 open terminal and screen 2 open browser). Is there a way to run them on the selected screen? Thx for the help.


1 Answer 1


If you have a single virtual display across several screens (so you can drag windows from one screen to the other), the position of an app window is defined by virtual screen coordinates. Some apps support specifying the window position at startup, with --geometry or a similar command line parameter. AFAIK firefox supports -width and -height. Check the manual for the programs that you use.

Alternatively, you can move/resize almost any window using xdotool:

xdotool search --onlyvisible --name firefox windowmove    0 1080 # skip the first FullHD screen
xdotool search --onlyvisible --name firefox windowsize 1920 1080 # Fullscreen on second FullHD screen

If you have separate Xorg displays on separate screens, then you can specify the screen using the DISPLAY variable, e.g.

DISPLAY=:1 firefox

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.