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

Having issues with your DietPi installation, or, found a bug? Post it here.
kolaborek
Posts: 19
Joined: Thu Mar 12, 2020 6:19 pm

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

Post by kolaborek »

It doesn't work...
Chromium start, but screen is not rotating. Before Chromium start I can see info "can't open DIsplay=:0" or something like that...
It looks like script rotate_screen.sh is executed before Chromium with graphical envoirement fully start.

Where can I find logs from start? I searched in /var/log but can't find anything that could looks like logs from start stage.
User avatar
Joulinar
Posts: 2587
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

pls can you post content of /var/lib/dietpi/postboot.d/rotate_screen.sh
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kolaborek
Posts: 19
Joined: Thu Mar 12, 2020 6:19 pm

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

Post by kolaborek »

Ok. Below is content:
root@DietPi:~# cat /var/lib/dietpi/postboot.d/rotate_screen.sh
#!/bin/dash\
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
root@DietPi:~#
Is it ok?
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

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

Post by MichaIng »

@kolaborek
There is a backslash behind the shebang that does not belong there:
#!/bin/dash\ needs to be #!/bin/dash
User avatar
Joulinar
Posts: 2587
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

what about the following to have a delay and to wait for chromium to start?

Code: Select all

/bin/bash -c "sleep 15&&DISPLAY=:0 xrandr --output HDMI-1 --rotate left" 
honestly I did not test it myself
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
kolaborek
Posts: 19
Joined: Thu Mar 12, 2020 6:19 pm

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

Post by kolaborek »

@MichaIng Indeed... what a fail from my side... I correct this, but this still won't work.
@Joulinar I thought about the same ;) I added 10s sleep to rotate_screen.sh and .... it was executed before Chromium starts...:

File now looks like below:
root@DietPi:~# cat /var/lib/dietpi/postboot.d/rotate_screen.sh
#!/bin/dash
sleep 10s
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
kolaborek
Posts: 19
Joined: Thu Mar 12, 2020 6:19 pm

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

Post by kolaborek »

I recorded video from boot. You can watch it below. After sleep command you can see that system can't open Display. This is because graphical envoirement with Chromium starts just after screen_rotate.sh script.

https://1drv.ms/v/s!AktdokBytgiDgsJoDOa ... Q?e=lFepmx

At fourteenth second you can watch this:
Image
User avatar
MichaIng
Site Admin
Posts: 2423
Joined: Sat Nov 18, 2017 6:21 pm

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

Post by MichaIng »

A makes sense that xrandr can only rotate a screen/x session that already exists... sleep does not help since dietpi-postboot then simply waits that sleep time before continuing, delaying Chromium start on login.
Hmm, there must be a way to tell the xserver directly to rotate the screen.

/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh contains xinit chromium as last line. xinit options can be set by appending -- <options> to the end of this line. But I can't fine an option to rotate the screen right via xinit.

But actually best is anyway to do all this via xorg.conf. What is the content of your current config(s)?

Code: Select all

cat /etc/X11/xorg.conf{,.d/*.conf}
It should basically work to only add Option "Rotate" "left" to the end of the "Monitor" section in /etc/X11/xorg.conf.d/99-dietpi-dpms_off.conf.

I am not sure whether a new file works as expected, e.g.

Code: Select all

cat << _EOF_ > /etc/X11/xorg.conf.d/01-rotate-screen.conf
Section "Monitor"

    Identifier "TV"
    Option "Rotate" "left"

EndSection
_EOF_
Not sure if now both settings, rotation + disabling power management, are added or if 99-dietpi-dpms_off.conf overrides 01-rotate-screen.conf completely. You could actually test it by naming the latter 99-rotate-screen.conf, so that it is parsed afterwards by alphabetical order.

The fbturbo error you faced when trying such before looks like there is simply no fbturbo driver/package installed. Where you got this entry from? I would just leave xorg.conf as it was or even remove it. It does not exist by default, until a certain acceleration driver package installs one.
kolaborek
Posts: 19
Joined: Thu Mar 12, 2020 6:19 pm

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

Post by kolaborek »

I found a workaround. Not beautiful, but it works :)

First. Starting browser.
Chromium isn't run by option 11 in dietpi-autostart but its starting by option 14 (/var/lib/dietpi/dietpi-autostart/custom.sh file).
I put in this file path to start Chromium:

Code: Select all

/var/lib/dietpi/dietpi-software/installed/chromium-autostart.sh
And second. Rotating screen.
In folder /var/lib/dietpit/postboot.d/ is created file 99-roate-screen.sh in which I pasted command:

Code: Select all

DISPLAY=:0 xrandr --output HDMI-1 --rotate left
Now, Chromium starts in rotate mode :)
User avatar
Joulinar
Posts: 2587
Joined: Sat Nov 16, 2019 12:49 am

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

Post by Joulinar »

Thx for sharing your final solution. Good to know that it is working now.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply