Skift ml. Wayland og Xorg
Source: Download script
Last Updated: 11. September 2025 by Agnete Moos (agms@sonderborg.dk)
Parameters:
Navn | Type | Standardværdi | Påkrævet |
---|---|---|---|
Click to see the source code
#! /usr/bin/env sh
set -ex
if get_os2borgerpc_config os2_product | grep --quiet kiosk; then
echo "This script has not been designed to be run on a Kiosk-machine. Exiting."
exit 1
fi
WAYLAND_FORCE="$1"
DISABLE_WAYLAND_FILE="/etc/lightdm/lightdm.conf.d/10-disable-wayland.conf"
DISABLE_XORG_FILE="/etc/lightdm/lightdm.conf.d/10-disable-xorg.conf"
LIGHTDM_CONF="/etc/lightdm/lightdm.conf"
if [ "$WAYLAND_FORCE" = "True" ]; then
rm $DISABLE_WAYLAND_FILE
# Remove the option to launch Xorg from LightDM
cat << EOF > $DISABLE_XORG_FILE
# No /usr/share/xsessions please
[LightDM]
sessions-directory=/usr/share/wayland-sessions:/usr/share/lightdm/sessions
EOF
# Stop launching Xorg-specific display-setup-script
if [ -f "/usr/share/os2borgerpc/bin/xset.sh" ]; then
sed --in-place "\@/usr/share/os2borgerpc/bin/xset.sh@d" $LIGHTDM_CONF
fi
else
rm $DISABLE_XORG_FILE
# Remove the option to launch Wayland from LightDM
cat << EOF > $DISABLE_WAYLAND_FILE
# No /usr/share/wayland-sessions please
[LightDM]
sessions-directory=/usr/share/xsessions:/usr/share/lightdm/sessions
EOF
# Start launching Xorg-specific display-setup-script, if it isn't already there
if [ -f "/usr/share/os2borgerpc/bin/xset.sh" ] && ! grep --quiet "/usr/share/os2borgerpc/bin/xset.sh" $LIGHTDM_CONF; then
echo "display-setup-script=/usr/share/os2borgerpc/bin/xset.sh" >> $LIGHTDM_CONF
fi
fi
Beskrivelse
Dette script skifter ml. hvilken “display server” der anvendes. Specifikt skifter det ml. om der køres Wayland (den nyere standard) eller Xorg (den ældre standard).
På nuværende tidspunkt - image 5.0.0 - er Xorg standard i OS2borgerPC, men planen er at skifte over til Wayland. Wayland er nemlig blevet standard i Ubuntu allerede fra 22.04.