Cannot start FullScreen mode using dietpi-autostart/custom.sh file

Hello,
I edited /var/lib/dietpi/dietpi-autostart/custom.sh file by adding line below:
xinit ‘/usr/bin/surf’ -F ‘https://google.com

Legend:

  • surf is lightweight browser


  • -F option for surf should open browser in FullScreen mode.

Page is opening in browser but only on the 1/4 of the screen (I have FullHD monitor).

Any idea what should I change to make it working on all screen area and is it possible to rotate the screen? I must do kiosk with simple, static webpage.

Best Regards

Hi,

Is there a reason why you did not use Chromium? Its offered by DietPi and easy to run in Kiosk mode.

I have BANANA PI BPI-M1 SINOVOIP with A20 ARM Dual-Core (1GHz).
When I run chromium, it takes about ~12% of CPU Time and ~12% of RAM. The same page opened in surf takes only 1,3% of CPU and 5,8% of RAM.
That is why I try to use surf. It is much smaller, but with my SBC and webpage which I want to display, it is very good.

BTW. Chromium also did not open on full screen. Its open webpage in little wider window, but it is still about 1/4 of screen.

basically if you like to use chromium, you would need to activate chromium resolution settings in dietpi.txt

# Chromium
SOFTWARE_CHROMIUM_RES_X=1920
SOFTWARE_CHROMIUM_RES_Y=1080
SOFTWARE_CHROMIUM_AUTOSTART_URL=https://dietpi.com

I think I’ll use chromium. I don’t have enough knowlege to switch it to surf browser.
But maybe you’ll know if DietPi can rotate screen 90* clockwise?

yup, you can rotate your screen

  1. run dietpi-config
  2. 1 : Display Options
  3. 4 : Rotation (HDMI)

there you can rotate

I searched in dietpi-config and can’t find it. But after your post I checked once again and indeed don’t have it.
In Display Options i have:
1: Display Resolution,
2: GPU/RAM Memory Split,
3: LCD Panel addon: [none],
16: Display Brightness,
17: X.Org DPI: [96]
14: Led Control

There is not option nr 4. Maybe it’s because my board?

yep indeed this is depending on your board. but I found this one one the web

https://bananapi.gitbooks.io/bpi-m3/content/en/howtorotatedisplayscreen.html

this might be the file to adjust for the xserver

/etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf

Probably you can create an additional file to add the command to rotate

/etc/X11/xorg.conf.d/01-rotate-screen.conf

Unfortunately I’m not able to test as I didn’t have such a board.

EDIT:

Ok. I found that xrandr can generate scripts to rotate screen. I copied command from that script to custom.sh file.
Now file looks like below, but xinit start and display console… xrandr and browser don’t run. What should I do to make commands to run one after the other?

xinit
xrandr --output HDMI-1 --primary --mode 1920x1080 --pos 0x0 --rotate left
‘/usr/bin/surf’ -F '> http://dietpi.com> ’

END of EDIT

I put below lines:

Section “Device”
Identifier “Raspberry Pi FBDEV”
Driver “fbturbo”
Option “fbdev” “/dev/fb0”
Option “SwapbuffersWait” “true”
Option “rotate” “cw”
EndSection

into file /etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf and tried with new file named /etc/X11/xorg.conf.d/01-rotate-screen.conf. Unfortunatelly without success.

Maybe logs tell you something?
Lat 50 messages from /var/log/Xorg.0.log are:

[ 53.704] (WW) The directory “/usr/share/fonts/X11/cyrillic” does not exist.
[ 53.704] Entry deleted from font path.
[ 53.704] (WW) The directory “/usr/share/fonts/X11/100dpi/” does not exist.
[ 53.704] Entry deleted from font path.
[ 53.704] (WW) The directory “/usr/share/fonts/X11/75dpi/” does not exist.
[ 53.704] Entry deleted from font path.
[ 53.704] (WW) The directory “/usr/share/fonts/X11/Type1” does not exist.
[ 53.704] Entry deleted from font path.
[ 53.704] (WW) The directory “/usr/share/fonts/X11/100dpi” does not exist.
[ 53.704] Entry deleted from font path.
[ 53.704] (WW) The directory “/usr/share/fonts/X11/75dpi” does not exist.
[ 53.704] Entry deleted from font path.
[ 53.704] (==) FontPath set to:
/usr/share/fonts/X11/misc,
built-ins
[ 53.704] (==) ModulePath set to “/usr/lib/xorg/modules”
[ 53.704] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[ 53.704] (II) Loader magic: 0x647f98
[ 53.704] (II) Module ABI versions:
[ 53.704] X.Org ANSI C Emulation: 0.4
[ 53.704] X.Org Video Driver: 24.0
[ 53.704] X.Org XInput driver : 24.1
[ 53.704] X.Org Server Extension : 10.0
[ 53.708] (–) using VT number 2

[ 53.708] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 53.713] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 53.719] (II) xfree86: Adding drm device (/dev/dri/card1)
[ 53.720] (II) no primary bus or device found
[ 53.720] falling back to /sys/devices/platform/display-engine/drm/card0
[ 53.720] (II) LoadModule: “glx”
[ 53.723] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 53.798] (II) Module glx: vendor=“X.Org Foundation”
[ 53.798] compiled for 1.20.4, module version = 1.0.0
[ 53.798] ABI class: X.Org Server Extension, version 10.0
[ 53.798] (II) LoadModule: “fbturbo”
[ 53.800] (WW) Warning, couldn’t open module fbturbo
[ 53.801] (EE) Failed to load module “fbturbo” (module does not exist, 0)
[ 53.801] (EE) No drivers available.
[ 53.801] (EE)
Fatal server error:
[ 53.801] (EE) no screens found(EE)
[ 53.801] (EE)
Please consult the The X.Org Foundation support
at > http://wiki.x.org
for help.
[ 53.802] (EE) Please also check the log file at “/var/log/Xorg.0.log” for additional information.
[ 53.802] (EE)
[ 53.802] (EE) Server terminated with error (1). Closing log file.

Rotate screen must be possible because when LXDE is launched I can rotate screen with xrandr. Just don’t know how to do it without LXDE.

how does it behave if you execute xrandr once chromium was started? so open a SSH session after browser start and do:

DISPLAY=:0 xrandr --output HDMI-1 --rotate left

I do not run xrandr when chromium was started. I move back and change autostart option to 16:LightDM login mask.
Then I play around with xrandr and generate script with command which I want to run from custom.sh file.

try to run chromium on autostart. once started, open a SSH session and execute the following

DISPLAY=:0 xrandr --output HDMI-1 --rotate left

Hello,

Thank you for your sugesstion.
Your command rotates screen, but … it looks like in the below picture.

I tried many different combinations, but I don’t know how to strech the picture to the monitors resolutions…

which browser you are using now?

This is chromium. When screen is not rotated, everything is ok - it covers all screen area. But when I rotate it to left it looks like in the picture.

Maybe changing resolution from 1920x1080 to 1080x1920 could help? But when I tried to run xrandr with -mode 1080x1920 I got error that there is no such mode.

Did you already try to switch the dietpi.txt Chromium resolution settings?

SOFTWARE_CHROMIUM_RES_X=1080
SOFTWARE_CHROMIUM_RES_Y=1920

Yes, I set it up, and before rotating it looks ok (look at screenshot below).
But when I rotate screen it looks like it rotates without changing resolution from 1920x1080 to 1080x1920 (I think…)


Helped changing resolution for chromium in dietpi.txt from

Chromium

SOFTWARE_CHROMIUM_RES_X=> 1920
SOFTWARE_CHROMIUM_RES_Y=> 1080
SOFTWARE_CHROMIUM_AUTOSTART_URL=> https://dietpi.com

to

Chromium

SOFTWARE_CHROMIUM_RES_X=> 1080
SOFTWARE_CHROMIUM_RES_Y=> 1920
SOFTWARE_CHROMIUM_AUTOSTART_URL=> https://dietpi.com

Now it looks like I wanted :slight_smile:

But after restart, screen rotate backs to its previous setting. What should I do to make it permanent?

kolaborek
You used DISPLAY=:0 xrandr --output HDMI-1 --rotate left besides the resolution switch, right?

echo -e '#!/bin/dash\nDISPLAY=:0 xrandr --output HDMI-1 --rotate left' > /var/lib/dietpi/postboot.d/rotate_screen.sh

This does the rotation at the end of boot, right before login/Chromium autostart. Should be what you need, but if it should be done on earlier boot stage, a dedicated systemd unit would be required.

yep xrandr is going to rotate screen juts for current session. It’s not a permanent rotation. So would need to be done right after boot as indicated by MichaIng