You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
891 B
38 lines
891 B
1 year ago
|
#!/bin/sh
|
||
|
|
||
|
usage()
|
||
|
{
|
||
|
echo "Enable/Disable Wayland in GDM"
|
||
|
echo "Usage: sphere-wayland-configure <--enable|--disable>"
|
||
|
echo
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
OPTION="$1"
|
||
|
|
||
|
echo $OPTION
|
||
|
|
||
|
if [ "$OPTION" != "--disable" -a "$OPTION" != "--enable" ]; then
|
||
|
echo "Unknown option"
|
||
|
usage
|
||
|
fi
|
||
|
|
||
|
if [ ! -f /etc/gdm/custom.conf ]; then
|
||
|
echo "GDM configuration file not found"
|
||
|
exit 5
|
||
|
fi
|
||
|
|
||
|
if [ "$OPTION" = "--enable" ]; then
|
||
|
sed -i '/^WaylandEnable=false/s@^@#@' /etc/gdm/custom.conf
|
||
|
sed -i '/^DefaultSession=/s@^@#@' /etc/gdm/custom.conf
|
||
|
|
||
|
echo "Wayland enabled, please restart gdm"
|
||
|
echo "sudo systemctl restart gdm.service"
|
||
|
elif [ "$OPTION" = "--disable" ]; then
|
||
|
sed -i '/^#WaylandEnable=false/s@^#@@' /etc/gdm/custom.conf
|
||
|
sed -i '/^#DefaultSession=/s@^#@@' /etc/gdm/custom.conf
|
||
|
|
||
|
echo "Wayland enabled, please restart gdm"
|
||
|
echo "sudo systemctl restart gdm.service"
|
||
|
fi
|