6

I've installed Raspian Jessie Lite and added on the minimum I can to get a browser running fullscreen. I started off with IceWeasel:

sudo apt-get install -y x-window-system iceweasel

And put this into my .xinitrc:

iceweasel "http://localhost/"

Now, when I run startx it loads IceWeasel. However, it only took up a small; portion of the screen. I was able to fix that by loading IceWeasel, closing it, then modifying the file that stored the window size and make it 1920x1080.

That was all fine, until I discovered IceWeasel didn't support all th nice new ECAMScript goodness Chrome did. So, I'm trying to swap for Chromium. I've managed to get it all installed, and I've changed my .xinitrc to this:

chromium-browser --start-maximized --kiosk http://localhost/

However, when this launches it only uses about (possibly exactly) half of the screen! I've tried various options but can't get it working. --start-fullscreen is even weirder and renders correctly but gets chopped in half! :(

Note: I'm trying to avoid installing any window manager/etc, as it seems like it shouldn't be required when IceWeasel is already all working correctly!?

IceWeasel:

Iceweasel fullscreen

Chromium (--start-maximized and --kiosk):

Chromium not-quite fullscreen!

Chromium (--start-fullscreen):

Chromium chopped in half

8

Ok, with help from this thread I got it working. Although that poster said it didn't work, I edited .config/chromium/Default/Preferences and explicitly set the window size:

Before

"window_placement":
{
    "bottom":1060,
    "docked":false,
    "left":10,
    "maximized":true,
    "right":950,
    "top":10
    // ...

After

"window_placement":
{
    "bottom":1080,
    "docked":false,
    "left":0,
    "maximized":true,
    "right":1920,
    "top":0
    // ...

I wondered if maybe this had been set badly by the first load of the app not being fullscreen, but I tried deleting ~/.config and then loading it again, but it just recreated it with the left half of the screen. I guess I'll have to script loading Chromium, killing it, then rewriting that part of the file in my setup script! ;(

  • 2
    Mate you are a genius! This drove me nuts for days and I had almost given up -- I thought it was an xserver issue but apparently, Chromium has an issue when started in Kiosk right away -- thanks so much! – Simon Mattes Jun 6 '17 at 21:01
  • 1
    If your Preferences file is missing window_placement, it can be added under the browser key. Reference: chromium.googlesource.com/chromium/chromium/+/… – Nemo Mar 9 at 14:06
1

If you want to start Chromium in fullscreen then try adding this to /etc/xdg/lxsession/LXDE/autostart

@chromium-browser -e Fullscreen -a http://google.com
1

Assuming your monitor is smaller then 7000px

chromium-browser --window-size=7000,7000 --start-fullscreen

This command will detect your screen height / width

Now you also can use it in a bash script:

/home/pi/full.sh

#!/bin/bash/ 
chromium-browser --window-size=7000,7000 --start-fullscreen

and then run

startx /home/pi/full.sh

It will launch a fullscreen browser, from a non-gui terminal :D.

NOT NEEDED,

but for fun I tested a bash code to get the screen resolution, but you don't need it..

#!/bin/bash
CMD="$(fbset -s | awk '$1 == "geometry" { print $2" "$3 }')"
echo "$CMD"
  • doesn't work for me – LtWorf Oct 13 '17 at 10:50
  • --window-size=7000,7000 sort of worked. – Jonathan Komar Oct 29 '17 at 17:02
0

You can try

--start-fullscreen Specifies if the browser should start in fullscreen mode, like if the user had pressed F11 right after startup.

as listed by Peter Beverloo's automatic web page of options.

  • Well, that one's even weirder... the window now takes up the full screen, yet the right half is black! I've edited a screenshot into my original question :( – Danny Tuppeny Apr 3 '16 at 12:16
  • That is weird! Does the cursor manage to travel over the black half? – meuh Apr 3 '16 at 12:22
  • Yeah, the cursor can go around the whole screen; just only the left half of Chromium is rendered. It's very weird; the rendered part is the same portion that --start-maximized set the window too. It's like some things are reading the screen size as half of what it actually is, and some is getting it correct (but why there would be two different ways for Chrome to figure out the screen size, I dunno!) – Danny Tuppeny Apr 3 '16 at 13:09
  • Got it sorted; see my answer. I can't explain why it happens (it also added a 10px border!), but I have a solution to it at least. Thanks! – Danny Tuppeny Apr 3 '16 at 13:29
  • doesn't work for me – LtWorf Oct 13 '17 at 10:50
0

I had the exact same symptoms, 10px offset top and left and only half the screen filled. I had trouble with the window_placement property not being there. Hardcoding the resolution wasn't an option for me since I want to support a wide range of monitors so I wrote this script that adds the window_placement property to the preferences file before starting the Chrome kiosk. It uses jq to manipulate the JSON file and xdpyinfo to grab the resolution, so before you can use it run:

sudo apt install jq

kiosk.sh

#!/bin/bash

CHROMIUM_FILE=~/.config/chromium/Default/Preferences
RESOLUTION=$(xdpyinfo | grep -Po "(?<=dimensions:)\s*([0-9]{1,}x[0-9]{1,})" | sed "s: ::g")
SCREEN_WIDTH=$(echo $RESOLUTION | cut -d'x' -f1)
SCREEN_HEIGHT=$(echo $RESOLUTION | cut -d'x' -f2)
printf -v WINDOW_PLACEMENT '.browser.window_placement |= {bottom: %s, right: %s, top: 0, left: 0, maximized: true}' $SCREEN_WIDTH $$

jq "$WINDOW_PLACEMENT" $CHROMIUM_FILE > tmp.json && mv tmp.json $CHROMIUM_FILE

chromium-browser --window-size=$SCREEN_WIDTH,$SCREEN_HEIGHT --start-maximized --no-default-browser-check --kiosk https://google.com

Interestingly, just writing the resolution into the JSON file wasn't enough. It fixed the 10px offset and made the window a little bit bigger but didn't fill the screen. Using the --window-size flag fixed that for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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