Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
raspberry-pi:official-touchscreen [2025/01/05 19:25] – removed - external edit (Unknown date) 127.0.0.1raspberry-pi:official-touchscreen [2026/03/15 19:02] (current) Zyzonix
Line 1: Line 1:
 +===== Official Raspberry Pi Touchscreen =====
 +
 +==== Rotating the Official 7" Touchscreen ====
 +
 +Create the following DESKTOP-file
 +<panel type="info" icon="glyphicon glyphicon-file" title="/etc/xdg/autostart/rotate-screen.desktop">
 +<code bash>
 +[Desktop Entry]
 +Type=Application
 +Name=Rotate DSI 180°
 +Exec=/usr/bin/wlr-randr --output DSI-1 --transform 180
 +Hidden=false
 +NoDisplay=false
 +X-GNOME-Autostart-enabled=true
 +</code>
 +</panel>
 +Check if DSI-1 is the correct display, use ''wlr-randr'' to check this out.
 +
 +**Legacy mode (pre-TRIXIE):**
 +++++ Show / Hide |
 +Comment the following line in your ''/boot/config.txt'' (to disable this parameter):
 +<code bash>
 +# Enable DRM VC4 V3D driver
 +#dtoverlay=vc4-kms-v3d
 +</code>
 +
 +And add the following line to your config:
 +<code bash>
 +# rotate screen
 +lcd_rotate=2
 +display_rotate=0
 +</code>
 +++++
 +
 +==== Run chromium in kiosk mode at startup ====
 +
 +Firstly enable autologin and boot to desktop. Therefore you can use the ''raspi-config''-tool:
 +<code bash>sudo raspi-config</code>
 +
 +Just add the following lines to the ''labwc'' (a Wayland compositor) config:
 +<panel type="info" icon="glyphicon glyphicon-file" title="nano ~/.config/labwc/autostart">
 +<code bash>
 +# The actual kiosk launch
 +# Use chromium (or chromium-browser — try both if one fails)
 +chromium \
 +    --kiosk \
 +    --noerrdialogs \
 +    --disable-infobars \
 +    --no-first-run \
 +    --start-maximized \
 +    --audio-buffer-size=16384 \
 +    --enable-features=OverlayScrollbar \
 +    https://your-website.com &
 +</code>
 +</panel>
 +This also includes already a higher buffer size for playing streams (e.g. internet radio)
 +
 +
 +**Legacy mode (X11):**
 +++++ Show / Hide |
 +And then add the following line to the user's ''lxsession'' config:
 +<panel type="info" icon="glyphicon glyphicon-file" title="~/.config/lxsession/LXDE-pi/autostart">
 +<code bash>@chromium-browser --kiosk --disable-pinch <url-to-open></code>
 +</panel>
 +
 +//Sourced from: [[https://baldbeardedbuilder.com/blog/setting-up-raspberry-pi-for-use-in-kiosk-mode-with-chromium/|baldbeardedbuilder.com - Chromium in kiosk mode]]//
 +++++
 +==== Turn off screen automatically after a period of inactivity ====
 +
 +To enable this "energy saving"-setting create a system service file under ''/etc/systemd/system/'' with the name ''screenblanking.service'':
 +<code bash>sudo nano /etc/systemd/system/screenblanking.service</code>
 +
 +Then add this content:
 +<code bash>
 +[Unit]
 +Description=Automatic screen blanking
 +After=network.target network-online.target
 +
 +[Service]
 +Environment=DISPLAY=:0.0
 +RestartSec=40
 +Restart=always
 +User=pi
 +ExecStart=/usr/bin/xset dpms force off
 +
 +[Install]
 +WantedBy=multi-user.target
 +</code>
 +
 +Finally save the service and enable it with:
 +<code bash>sudo systemctl enable screenblanking.service</code>
 +
 +//Partially sourced from [[https://forums.raspberrypi.com/viewtopic.php?t=281523|forums.raspberrypi.com - know a command-line for turning off the screen?]]//
 +