kser
Posts: 3
Joined: Mon Nov 19, 2018 2:42 pm

Chromium problem

Thu Aug 08, 2019 6:55 am

Hi,
I have a new RPI 4 with two hdmi output. I'm trying to run two instances of chromium on two screens.
I'm using bare openbox with only chromium in kiosk mode in autostart, but even with two calls to chromium in script it still runs only one, but when I kill one after 2 seconds pops the missing one. I was trying to change profile directory but without any success.

User avatar
topguy
Posts: 5882
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Chromium problem

Thu Aug 08, 2019 9:09 am

Can we see your script ?

Sounds like you forgot to spawn off the first chromium in the background by adding a "&" at the end of the command line.

silvershrimp0
Posts: 3
Joined: Tue Aug 20, 2019 10:20 pm

Re: Chromium problem

Tue Aug 20, 2019 10:31 pm

I'm having the same issue. I'm display different pages on different monitors. The first page will come up on the first monitor, but the 2nd will be blank. If I force close the first instance, the 2nd page will show up on the 2nd monitor. They'll both display correctly on the correct monitor, just not at the same time. I went off the guide here: https://die-antwort.eu/techblog/2017-12 ... iosk-mode/

Code: Select all

# Disable any form of screen saver / screen blanking / power management
xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

# Start Chromium in kiosk mode
chromium-browser --new-window --disable-infobars --kiosk 'url1' --noerrdialogs --kiosk --window-position=0,0 --incognito --disable-session-crashed-bubble
chromium-browser --new-window --disable-infobars --kiosk 'url2' --noerrdialogs --kiosk --window-position=1280,0 --incognito --disable-session-crashed-bubble
Edit to add: If I try adding a & to the end of the first chromium line, it will work sometimes, but most of the time they'll just show on top of each other on the same screen. On the random occasion that it works correctly, if I reboot without making any changes they'll end up popping up on the same screen on top of each other.

User avatar
topguy
Posts: 5882
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Chromium problem

Thu Aug 22, 2019 10:48 am

My answer is the same, you add a "&" at the end of the line of the first call to chromium.

silvershrimp0
Posts: 3
Joined: Tue Aug 20, 2019 10:20 pm

Re: Chromium problem

Thu Aug 22, 2019 12:18 pm

As I stated in my original post, I added the &, which caused a different set of problems.

User avatar
topguy
Posts: 5882
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Chromium problem

Thu Aug 22, 2019 12:28 pm

Maybe add a "sleep 5" between them then..
I dont really know why launching them at the same time would mess up the "-window-position" option for one of them. That might be a Chromium bug.

silvershrimp0
Posts: 3
Joined: Tue Aug 20, 2019 10:20 pm

Re: Chromium problem

Thu Aug 22, 2019 2:07 pm

Yeah, I've also tried that. I just makes the 2nd window wait before it pops up in the wrong spot.

I've tried reordering the switches, changing from --kiosk to --start-fullscreen, adjusting the --window-position switch too, but it seems to behave the same way. It will randomly work as intended sometimes, but most of the time the windows will be on top of each other on the same screen.

I'm leaning towards it being a chrome bug as well.

I think for my purposes, I'll just have to run two Pis for now.

Code: Select all


xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

#set resolution
xrandr --output HDMI-1 --primary --mode 1680x1050 --rate 59.88 --pos 0x0 --rotate normal --output HDMI-2 --mode 1280x1024 --rate 60.02 --pos 1680x0 --rotate normal

workspace 1 output HDMI1
workspace 2 output HDMI2





# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences


chromium-browser --class=chromium-no-1 --new-window --disable-infobars --window-position=0,0 --start-fullscreen 'http://url1' --noerrdialogs --disable-session-crashed-bubble --profile=dash1&
sleep5
chromium-browser --class=chromium-no-2 --new-window --disable-infobars --window-position=1681,0 --start-fullscreen 'http://url2' --noerrdialogs --disable-session-crashed-bubble --profile=dash2


for_window [class="^chromium-no-1$"] move workspace number 1
for_window [class="^chromium-no-2$"] move workspace number 2

unclutter -idle 1



User avatar
topguy
Posts: 5882
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Chromium problem

Fri Aug 23, 2019 10:31 pm

There are tools like "xdotool" that can send commands to windows and also manipulate the window manager to move and resize them.

lcuwebmaster
Posts: 1
Joined: Tue Oct 15, 2019 9:44 pm

Re: Chromium problem

Tue Oct 15, 2019 9:48 pm

silvershrimp0 wrote:
Thu Aug 22, 2019 2:07 pm
Yeah, I've also tried that. I just makes the 2nd window wait before it pops up in the wrong spot.

I've tried reordering the switches, changing from --kiosk to --start-fullscreen, adjusting the --window-position switch too, but it seems to behave the same way. It will randomly work as intended sometimes, but most of the time the windows will be on top of each other on the same screen.

I'm leaning towards it being a chrome bug as well.

I think for my purposes, I'll just have to run two Pis for now.

Code: Select all


xset s off
xset s noblank
xset -dpms

# Allow quitting the X server with CTRL-ATL-Backspace
setxkbmap -option terminate:ctrl_alt_bksp

#set resolution
xrandr --output HDMI-1 --primary --mode 1680x1050 --rate 59.88 --pos 0x0 --rotate normal --output HDMI-2 --mode 1280x1024 --rate 60.02 --pos 1680x0 --rotate normal

workspace 1 output HDMI1
workspace 2 output HDMI2





# Start Chromium in kiosk mode
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' ~/.config/chromium/'Local State'
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/; s/"exit_type":"[^"]\+"/"exit_type":"Normal"/' ~/.config/chromium/Default/Preferences


chromium-browser --class=chromium-no-1 --new-window --disable-infobars --window-position=0,0 --start-fullscreen 'http://url1' --noerrdialogs --disable-session-crashed-bubble --profile=dash1&
sleep5
chromium-browser --class=chromium-no-2 --new-window --disable-infobars --window-position=1681,0 --start-fullscreen 'http://url2' --noerrdialogs --disable-session-crashed-bubble --profile=dash2


for_window [class="^chromium-no-1$"] move workspace number 1
for_window [class="^chromium-no-2$"] move workspace number 2

unclutter -idle 1


@silvershrimp0
did the code you provide here work for you. I tried it and my screens still are a mirror of each other.

Return to “General programming discussion”