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.
Cannot start FullScreen mode using dietpi-autostart/custom.sh file Topic is solved
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
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
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
Ok. Below is content:
Is it ok?root@DietPi:~# cat /var/lib/dietpi/postboot.d/rotate_screen.sh
#!/bin/dash\
DISPLAY=:0 xrandr --output HDMI-1 --rotate left
root@DietPi:~#
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
@kolaborek
There is a backslash behind the shebang that does not belong there:
#!/bin/dash\ needs to be #!/bin/dash
There is a backslash behind the shebang that does not belong there:
#!/bin/dash\ needs to be #!/bin/dash
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
what about the following to have a delay and to wait for chromium to start?
honestly I did not test it myself
Code: Select all
/bin/bash -c "sleep 15&&DISPLAY=:0 xrandr --output HDMI-1 --rotate left"
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
@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:
@Joulinar I thought about the same

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
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
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:

https://1drv.ms/v/s!AktdokBytgiDgsJoDOa ... Q?e=lFepmx
At fourteenth second you can watch this:
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
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)?
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.
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.
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}
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_
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.
Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
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:
And second. Rotating screen.
In folder /var/lib/dietpit/postboot.d/ is created file 99-roate-screen.sh in which I pasted command:
Now, Chromium starts in rotate mode 

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
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

Re: Cannot start FullScreen mode using dietpi-autostart/custom.sh file
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