Enable Anydesk on Linux

 By default, Anydesk doesn't work on Ubuntu as it uses a different display server than what is expected by Anydesk (it expects the traditional X11 rather than Wayland).

Dump this into a file, say, "fix_anydesk.sh", and then run it with

sudo bash fix_anydesk.sh

The script:

#!/bin/bash
# Check if the user has root privileges
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 
   exit 1
fi
# Backup the GDM configuration file
GDM_CONFIG="/etc/gdm3/custom.conf"
if [[ -f "$GDM_CONFIG" ]]; then
    cp "$GDM_CONFIG" "$GDM_CONFIG.bak"
    echo "Backup of custom.conf created."
else
    echo "GDM configuration file not found."
    exit 1
fi
# Disable Wayland by uncommenting and setting the 'WaylandEnable' option to false
sed -i 's/#WaylandEnable=false/WaylandEnable=false/' "$GDM_CONFIG"
# Inform the user
echo "Wayland has been disabled. The system will use X11 instead."
# Restart GDM to apply the changes
systemctl restart gdm3
# Inform the user that the script is done
echo "Display manager restarted. You may need to log out or restart the system for changes to take full effect."

Popular posts from this blog

throttle traffic on apache

Pause a program which is using too much CPU

/var/log/journal taking up lots of space