2

I am running the latest Raspbian on raspberrypi 4 with 2 HDMI touchscreen monitors. My goal is to have a chromium page open full screen across both screens.

I tried the solution posted here: Treat 2 displays as 1 in Raspbian

Aka: https://gist.github.com/eslindsey/70bbc0080e335b38836fab09d19686d0

This Gist allows you to supply an arbitrary command (and optional arguments), and detects the created window and screen size automatically.

Concept

    chromium-browser --kiosk <url> &
    sleep 5
    wmctrl -r Chromium -b remove,fullscreen
    wmctrl -r Chromium -b remove,maximized_vert,maximized_horz
    wmctrl -r Chromium -e 0,0,0,3840,1080

The Chromium window does resize to fill the width of both screens, but the top minimize/maximize/close toolbar has re-opened, defeating the point of kiosk mode. Has anyone had any experience with this?

2 Answers 2

1

It took me hours of researching and try and error to find a solution. Resizing the window with wmctrl did only work, after I resized it once with my mouse and was therefore not suited for a mouse and keyboard-less setup. Furthermore did I want to achieve a true Fullscreen-mode for the best kiosk-like experience. This is how it finally worked for me:

First set your second display in clone-mode, so that it clones display one (in my case at a Raspberry Pi 4 HDMI-1 and HDMI-2):

xrandr --output HDMI-2 --same-as HDMI-1

Next determine your screen dimensions:

xrandr

This gives you a list of connected screens and their resolutions. You then have to compute the total screen size of all monitors together by adding them up. I attached two 1280x1024 monitors, so my total screen size combined is 2560x1024. As xrandr does not allow us to set a screen size larger than the monitor itself via the --fb flag, we use the --panning option:

xrandr --output HDMI-1 --panning 2560x1024+0+0/0x0+0+0/0/0/0/0

This sets a larger screen but only displays a portion of it on monitor 1. It also disables mouse panning, as we want monitor 2 to display the rest of the image. Last we have to pan monitor 2 to the right half of the large screen with:

xrandr --output HDMI-2 --pos 1280x0

and 1280 being the end of monitor 1.

You can now put the three commands in autostart to have them enabled on startup.

Some final remarks:

If you are on a SSH-Session, you have to add DISPLAY=:0 at the beginning of your xrandr-commands (e.g. DISPLAY=:0 xrandr --output HDMI-2 --same-as HDMI-1).

When you want to achieve a videowall like look, you can easily implement bezel-compensation by enlarging your virtual screen. In my case the bezels of my monitor are roughly 64 pixels thick, so you would set your output on monitor 1 to 2624 instead of 2560. Then you set your second monitor to start at pos 1344x0 leaving 64 pixels not displayed.

Links that helped:

https://bbs.archlinux.org/viewtopic.php?id=214841 http://www.straightrunning.com/tools/xrandr.html#sect3 http://www.mshopf.de/pub/Fosdem_2009_randr13_Slides.pdf Treat 2 displays as 1 in Raspbian

Good luck!

1
  • I managed to achieve similar results with this command: xrandr --output HDMI-0 --panning 7680x2160+0+0 --output DP-4 --panning 3840x2160+3840+0 Commented Sep 29, 2022 at 16:02
0

I came upon this post trying to do the same thing. After some wrangling, this process gets me to a two-monitor spanning Chromium window in kiosk mode:

chromium --kiosk http://localhost:1337
wmctrl -r Chromium -b remove,fullscreen
wmctrl -r Chromium -e 0,0,0,1600,1280

The tab bar is still there, and I discovered (by accident) that right-clicking on it brought up the "Undecorate" option, which mimics kiosk mode again.

I found this "toggle-decorations" command-line tool: https://gist.github.com/cat-in-136/96ee8e96e81e0cc763d085ed697fe193

./toggle-decorations $(wmctrl -lx | grep -E "Chromium" | grep -oE "0x[0-9a-z]{8}")

Chromium is now kiosk-like again.

Hope this helps someone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .