Skip to content

Instantly share code, notes, and snippets.

@digitalsparky
Last active December 31, 2021 16:34
Show Gist options
  • Save digitalsparky/5cd49d7b74a4251735c0ed7e98cb8ee5 to your computer and use it in GitHub Desktop.
Save digitalsparky/5cd49d7b74a4251735c0ed7e98cb8ee5 to your computer and use it in GitHub Desktop.
Enable Wayland on Pop_OS!
#!/bin/bash
set -e
GDMFILE="/etc/gdm3/custom.conf"
GDMBACKUPSUFFIX=".bak"
GDMBACKUPFILE="${GDMFILE}${GDMBACKUPSUFFIX}"
if [ ! -f "${GDMFILE}" ]; then
echo "GDM Config file missing, are you sure you're using GDM?"
exit 1
fi
if [ -f "${GDMBACKUPFILE}" ]; then
echo "Backup file already exists, bailing out to ensure we don't overwrite a previous backup"
echo "Please move this old backup then run this script again"
echo "File: ${GDMBACKUPFILE}"
exit 1
fi
sudo sed -i${GDMBACKUPSUFFIX} -r 's/^WaylandEnable=false/\#WaylandEnable=false/g' ${GDMFILE}
if [ "$?" -gt 0 ]; then
echo "Failed to update configuration to enable Wayland"
exit 1
else
echo "Wayland has now been enabled, please reboot then on the login screen select the Wayland option"
echo "If you need to revert this configuration change, a backup of the config is available here: ${GDMBACKUPFILE}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment